Exemplo n.º 1
0
 /**
  * @expectedException \Edge\Core\Exceptions\Forbidden
  */
 public function testUserWithNoPermissions()
 {
     $user = parent::getUser(["username" => "edge"], ["hasPrivilege"]);
     $user->method('hasPrivilege')->willReturn(false);
     $filter = $this->getFilter(["permissions" => ["Delete User"], "user" => $user]);
     $filter->preProcess(Edge::app()->response, Edge::app()->request);
 }
Exemplo n.º 2
0
 public function setUp()
 {
     parent::setUp();
     $_SERVER['REQUEST_METHOD'] = 'POST';
     $_SERVER['REQUEST_URI'] = '/test/method';
     $this->filter = new CsrfProtection(["tokenName" => "token"]);
 }
Exemplo n.º 3
0
 public function tearDown()
 {
     parent::tearDown();
     $dir = "/tmp/edge_files";
     @unlink("/tmp/file1.js");
     @unlink("/tmp/file1.css");
     if (is_dir($dir)) {
         $files = glob("{$dir}/*");
         foreach ($files as $file) {
             unlink($file);
         }
         rmdir($dir);
     }
 }
Exemplo n.º 4
0
 protected function invokeRouter()
 {
     $this->mockResponse();
     $router = parent::initRouter();
     $router->invoke();
 }
Exemplo n.º 5
0
 public function tearDown()
 {
     $this->user->delete();
     parent::tearDown();
 }
Exemplo n.º 6
0
 public function setUp()
 {
     parent::setUp();
     $this->cookie = new Cookie(array('secure' => false, 'sign' => true, 'secret' => 'C7s9r7yYYyVCDZZstzyl', 'httpOnly' => true));
 }
Exemplo n.º 7
0
 public function tearDown()
 {
     parent::tearDown();
     unset($_SERVER['HTTP_X_REQUESTED_WITH']);
 }
Exemplo n.º 8
0
 public function setUp()
 {
     parent::setUp();
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $this->filter = new DynamicOutput();
 }
Exemplo n.º 9
0
 public function tearDown()
 {
     Edge::app()->cache->delete("page_cache");
     parent::tearDown();
 }