Skip to content

Commit

Permalink
Ignore fragments when checking routes (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
cs278 committed Mar 15, 2024
1 parent 666c35c commit e45d5af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Codeception/Module/Symfony/RouterAssertionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public function seeCurrentRouteIs(string $routeName, array $params = []): void
}

$uri = explode('?', $this->grabFromCurrentUrl())[0];
$uri = explode('#', $uri)[0];
$match = [];
try {
$match = $router->match($uri);
Expand Down Expand Up @@ -147,6 +148,7 @@ public function seeInCurrentRoute(string $routeName): void
}

$uri = explode('?', $this->grabFromCurrentUrl())[0];
$uri = explode('#', $uri)[0];
$matchedRouteName = '';
try {
$matchedRouteName = (string)$router->match($uri)['_route'];
Expand All @@ -161,4 +163,4 @@ protected function grabRouterService(): RouterInterface
{
return $this->grabService('router');
}
}
}

0 comments on commit e45d5af

Please sign in to comment.