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); } }
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')); }
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()); }