test: update route matcher tests

This commit is contained in:
Funky Waddle 2026-02-14 17:28:28 -06:00
parent 2a26cf6544
commit 566ed2d878

View file

@ -11,7 +11,7 @@ final class RouteMatcherTest extends TestCase
{ {
public function testReturnsRouteOnSuccessfulMatch(): void public function testReturnsRouteOnSuccessfulMatch(): void
{ {
$config = new \Atlas\Tests\Config\Config([ $config = new \Atlas\Config\Config([
'modules_path' => ['/path/to/modules'] 'modules_path' => ['/path/to/modules']
]); ]);
@ -38,7 +38,7 @@ final class RouteMatcherTest extends TestCase
public function testReturnsNullOnNoMatch(): void public function testReturnsNullOnNoMatch(): void
{ {
$config = new \Atlas\Tests\Config\Config([ $config = new \Atlas\Config\Config([
'modules_path' => ['/path/to/modules'] 'modules_path' => ['/path/to/modules']
]); ]);
@ -63,7 +63,7 @@ final class RouteMatcherTest extends TestCase
public function testCaseInsensitiveHttpMethodMatching(): void public function testCaseInsensitiveHttpMethodMatching(): void
{ {
$config = new \Atlas\Tests\Config\Config([ $config = new \Atlas\Config\Config([
'modules_path' => ['/path/to/modules'] 'modules_path' => ['/path/to/modules']
]); ]);
@ -88,7 +88,7 @@ final class RouteMatcherTest extends TestCase
public function testRouteCollectionIteratesCorrectly(): void public function testRouteCollectionIteratesCorrectly(): void
{ {
$config = new \Atlas\Tests\Config\Config([ $config = new \Atlas\Config\Config([
'modules_path' => ['/path/to/modules'] 'modules_path' => ['/path/to/modules']
]); ]);
@ -108,7 +108,7 @@ final class RouteMatcherTest extends TestCase
public function testUrlGenerationWithNamedRoute(): void public function testUrlGenerationWithNamedRoute(): void
{ {
$config = new \Atlas\Tests\Config\Config([ $config = new \Atlas\Config\Config([
'modules_path' => ['/path/to/modules'] 'modules_path' => ['/path/to/modules']
]); ]);
@ -123,19 +123,18 @@ final class RouteMatcherTest extends TestCase
public function testHttpMethodsReturnSameInstanceForChaining(): void public function testHttpMethodsReturnSameInstanceForChaining(): void
{ {
$config = new \Atlas\Tests\Config\Config([ $config = new \Atlas\Config\Config([
'modules_path' => ['/path/to/modules'] 'modules_path' => ['/path/to/modules']
]); ]);
$router = new \Atlas\Router\Router($config); $router = new \Atlas\Router\Router($config);
$methodsResult = $router $router->get('/get', 'Handler');
->get('/get', 'Handler') $router->post('/post', 'Handler');
->post('/post', 'Handler') $router->put('/put', 'Handler');
->put('/put', 'Handler') $router->patch('/patch', 'Handler');
->patch('/patch', 'Handler') $router->delete('/delete', 'Handler');
->delete('/delete', 'Handler');
$this->assertTrue($methodsResult instanceof \Atlas\Router\Router); $this->assertCount(5, $router->getRoutes());
} }
} }