Skip to content

Commit 01edf81

Browse files
committed
feat: add new test for 404 page
1 parent 34e1453 commit 01edf81

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/Feature/RoutesTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,20 @@ public function testRoute()
1313
'HTTP_HOST' => 'example.com',
1414
'REQUEST_METHOD' => 'GET',
1515
'REQUEST_URI' => '/',
16-
], [], [], [], []));
16+
]));
1717

1818
$this->assertResponseOk();
19-
$this->assertEquals('<h1>Hello World!</h1>', $response);
19+
$this->assertEquals('<h1>Hello world!</h1>', $response);
20+
}
21+
22+
public function testNotFoundRoute()
23+
{
24+
$response = $this->runRequest(ServerRequestFactory::fromGlobals([
25+
'HTTP_HOST' => 'example.com',
26+
'REQUEST_METHOD' => 'GET',
27+
'REQUEST_URI' => '/test',
28+
]));
29+
$this->assertResponseCodeEquals(404);
30+
$this->assertEquals('File not found.', $response);
2031
}
2132
}

0 commit comments

Comments
 (0)