/** * 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); }
/** * 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()); }
/** * 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()); }
/** * Dispatch controller * - as user * - with permission */ public function testIndex() { $this->setupSuperUserIdentity(); $this->dispatchUri('dashboard/index'); $this->assertEquals(200, Response::getStatusCode()); }