Skip to content

Commit e45d5af

Browse files
authored
Ignore fragments when checking routes (#185)
1 parent 666c35c commit e45d5af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Codeception/Module/Symfony/RouterAssertionsTrait.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public function seeCurrentRouteIs(string $routeName, array $params = []): void
117117
}
118118

119119
$uri = explode('?', $this->grabFromCurrentUrl())[0];
120+
$uri = explode('#', $uri)[0];
120121
$match = [];
121122
try {
122123
$match = $router->match($uri);
@@ -147,6 +148,7 @@ public function seeInCurrentRoute(string $routeName): void
147148
}
148149

149150
$uri = explode('?', $this->grabFromCurrentUrl())[0];
151+
$uri = explode('#', $uri)[0];
150152
$matchedRouteName = '';
151153
try {
152154
$matchedRouteName = (string)$router->match($uri)['_route'];
@@ -161,4 +163,4 @@ protected function grabRouterService(): RouterInterface
161163
{
162164
return $this->grabService('router');
163165
}
164-
}
166+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy