Backwards compatibility break in `RouterAssertionsTrait::seeCurrentRouteIs()`

Open Beginner friendly
#245 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php, symfony
Domain
backend, testing

Research direction

Start in src/Codeception/Module/Symfony/RouterAssertionsTrait.php at seeCurrentRouteIs(), and compare the behavior introduced by pull request #227. Reproduce the documented call with an integer id, then add or update a regression test if the existing test suite has coverage for this assertion. Done means prior calls continue comparing integer route parameters without converting them to strings.

Written by the indexing model from the issue text.

Description

https://github.com/Codeception/module-symfony/pull/227 broke backwards compatibility with tests written for prior versions of the module.

The following test now fails:

$I->seeCurrentRouteIs('some_route', [
    'id' => 1,
]);

With:

- Expected | + Actual
@@ @@
Array &0 [
'_route' => 'some_route',
-    'id' => 1,
+    'id' => '1',
]

This usage is even how the method is documented:

https://github.com/Codeception/module-symfony/blob/01cfa3e12917e396cf99cee1fb63a553865cad16/src/Codeception/Module/Symfony/RouterAssertionsTrait.php#L87

Dominant language
PHP
Stars
96
Forks
25
Avg merge
2h 35m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.