コード例 #1
0
 public function testNotFoundHandling()
 {
     try {
         $response = $this->application->handle(Request::create('/invalid-url'));
         throw new \RuntimeException('Application in debug mode should throws NotFoundHttpException');
     } catch (\Symfony\Component\HttpKernel\Exception\NotFoundHttpException $e) {
         $this->assertTrue(true);
     }
 }
コード例 #2
0
 public function testRedirectToLoginIfNotLogged()
 {
     $request = Request::create('/account');
     $response = $this->application->handle($request);
     $this->assertEquals(302, $response->getStatusCode());
     $this->assertTrue($this->containsString($response->getContent(), 'Redirecting to /login'));
 }
コード例 #3
0
 public function testNotFoundHandling()
 {
     $response = $this->application->handle(Request::create('/invalid-url'));
     $this->assertEquals('Something went wrong! (No route found for "GET /invalid-url")', $response->getContent());
 }