Skip to content

Commit 28998fd

Browse files
authored
Fix strategy to match actions (#59)
1 parent c86ccb4 commit 28998fd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Codeception/Module/Symfony.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,8 @@ public function amOnAction(string $action, array $params = [])
936936
$routes = $router->getRouteCollection()->getIterator();
937937

938938
foreach ($routes as $route) {
939-
$controller = basename($route->getDefault('_controller'));
940-
if ($controller === $action) {
939+
$controller = $route->getDefault('_controller');
940+
if (substr_compare($controller, $action, -strlen($action)) === 0) {
941941
$resource = $router->match($route->getPath());
942942
$url = $router->generate(
943943
$resource['_route'],
@@ -1096,8 +1096,8 @@ public function seeCurrentActionIs(string $action)
10961096
$routes = $router->getRouteCollection()->getIterator();
10971097

10981098
foreach ($routes as $route) {
1099-
$controller = basename($route->getDefault('_controller'));
1100-
if ($controller === $action) {
1099+
$controller = $route->getDefault('_controller');
1100+
if (substr_compare($controller, $action, -strlen($action)) === 0) {
11011101
$request = $this->client->getRequest();
11021102
$currentAction = basename($request->attributes->get('_controller'));
11031103

0 commit comments

Comments
 (0)