Skip to content

Commit

Permalink
Fix unit test in FastRouteDispatcherTest
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Dec 13, 2023
1 parent 39d39d3 commit 675d80c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/Routing/FastRouteDispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@ public function testDispatchMethodWithClassAndSlytherinRouter()

$router->prefix('', 'Rougin\Slytherin\Fixture\Classes');

$router->get('/', 'NewClass@index');
$router->get('/hi/:name', function ($name)
{
return 'Hello ' . $name . '!';
});

$dispatcher = new FastRouteDispatcher($router);

$controller = new NewClass;
$route = $dispatcher->dispatch('GET', '/hi/Slytherin');

$route = $dispatcher->dispatch('GET', '/');

$expected = (string) $controller->index();
$expected = (string) 'Hello Slytherin!';

$actual = $this->resolve($route);

Expand All @@ -69,13 +70,13 @@ public function testDispatchMethodWithClassAndPhrouteRouter()

$router->prefix('', 'Rougin\Slytherin\Fixture\Classes');

$router->get('/hello/:name', 'NewClass@index');
$router->get('/', 'NewClass@index');

$dispatcher = new FastRouteDispatcher($router);

$controller = new NewClass;

$route = $dispatcher->dispatch('GET', '/hello/Slytherin');
$route = $dispatcher->dispatch('GET', '/');

$expected = (string) $controller->index();

Expand Down

0 comments on commit 675d80c

Please sign in to comment.