Example #1
0
 /**
  * test for Page not found
  *
  * @return void
  */
 public function testNotFoundError404()
 {
     $this->dispatchUri(uniqid('module') . '/' . uniqid('controller'));
     $this->assertModule('error');
     $this->assertController('index');
     $this->assertEquals(Response::getStatusCode(), 404);
 }
Example #2
0
 /**
  * Assert forbidden
  *
  * @return void
  */
 protected function assertForbidden()
 {
     $exception = Response::getException();
     $this->assertInstanceOf('\\Bluz\\Application\\Exception\\ForbiddenException', $exception);
     $this->assertEquals(403, Response::getStatusCode());
     $this->assertModule(Router::getErrorModule());
     $this->assertController(Router::getErrorController());
 }
Example #3
0
 /**
  * PUT request with PRIMARY should UPDATE record
  */
 public function testUpdateWithSameDate()
 {
     Request::setMethod(Request::METHOD_PUT);
     Request::setRawParams([1]);
     Request::setParams(['name' => 'Donatello', 'email' => '*****@*****.**']);
     $result = $this->processRest();
     $this->assertFalse($result);
     $this->assertEquals(304, Response::getStatusCode());
 }
Example #4
0
 /**
  * Dispatch controller
  *  - as user
  *  - with permission
  */
 public function testIndex()
 {
     $this->setupSuperUserIdentity();
     $this->dispatchUri('dashboard/index');
     $this->assertEquals(200, Response::getStatusCode());
 }