Skip to content

Commit

Permalink
Added minor test assertion to test route match
Browse files Browse the repository at this point in the history
  • Loading branch information
divineniiquaye committed Dec 7, 2022
1 parent 8824413 commit af2141b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ function (ServerRequestInterface $req, RequestHandlerInterface $handler) use ($f
}
}

try {
$router->match(Router::METHOD_DELETE, new Uri('/a/22'));
} catch (MethodNotAllowedException $e) {
t\assertSame('Route with "/a/22" path requires request method(s) [GET], "DELETE" is invalid.', $e->getMessage());
}

$route1 = $router->match(Router::METHOD_GET, new Uri('/fr/blog'));
$route2 = $router->matchRequest(new ServerRequest(Router::METHOD_GET, 'http://localhost/chuck12/hello/1/2'));
$route3 = $router->matchRequest(new ServerRequest(Router::METHOD_GET, '/a/333'));
Expand Down

0 comments on commit af2141b

Please sign in to comment.