-
-
Notifications
You must be signed in to change notification settings - Fork 166
Fix an issue with numeric data provider keys and run tests with format clear for both PHPUnit >= 10 and PHPUnit < 10 #1900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
$methodNameWithDataProviderResult = sprintf('%s with data set "%s"', $methodName, $dataProviderKey); | ||
if (preg_match('/#(\d+)/', $dataProviderKey)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (preg_match('/#(\d+)/', $dataProviderKey)) { | |
if (preg_match('/#(\d+)$/', $dataProviderKey)) { |
How can we be sure we are not catching digits in the middle of the string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^#(\d+)$
will do the trick
ff6091a
to
f573156
Compare
…t clear for both PHPUnit >= 10 and PHPUnit < 10
f573156
to
a2ad0be
Compare
I think the issue with E2E is not related to my changes. cc @theofidry |
seems like rerunning has fixed it (PR has been automatically merged), however fails on Thank you for fixing it, @sidz! |
no, it fails. Created #1901 |
|
||
$methodNameWithDataProviderResult = sprintf('%s with data set "%s"', $methodName, $dataProviderKey); | ||
if (preg_match('/^(\d+)$/', $dataProviderKey) === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't is_numeric()
way faster than a regular expression? Also, the parentheses are redundant, aren't they?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we go: #1904
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @MidnightDesign. I choose preg_match
as initially thought that numeric string looks like ##123
. But after that I just forgot to replace this part of code.
Thanks for highlighting this
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [infection/infection](https://togithub.com/infection/infection) | `^0.27.8` -> `^0.27.9` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [php-cs-fixer/shim](https://togithub.com/PHP-CS-Fixer/shim) | `^3.40.2` -> `^3.41.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [phpstan/phpstan](https://togithub.com/phpstan/phpstan) | `^1.10.47` -> `^1.10.48` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>infection/infection (infection/infection)</summary> ### [`v0.27.9`](https://togithub.com/infection/infection/releases/tag/0.27.9): Fix an issue with numeric data provider keys in PHPUnit >= 10 [Compare Source](https://togithub.com/infection/infection/compare/0.27.8...0.27.9) **Fixed:** - Fix an issue with numeric data provider keys and run tests with format clear for both PHPUnit >= 10 and PHPUnit < 10 by [@​sidz](https://togithub.com/sidz) in [https://github.com/infection/infection/pull/1900](https://togithub.com/infection/infection/pull/1900) - Disable Box Requirements Checker as it conflicts with symfony/service-contracts package by [@​sidz](https://togithub.com/sidz) in [https://github.com/infection/infection/pull/1902](https://togithub.com/infection/infection/pull/1902) - build: Disable the requirement checker by [@​theofidry](https://togithub.com/theofidry) in [https://github.com/infection/infection/pull/1903](https://togithub.com/infection/infection/pull/1903) **Full Changelog**: infection/infection@0.27.8...0.27.9 </details> <details> <summary>PHP-CS-Fixer/shim (php-cs-fixer/shim)</summary> ### [`v3.41.0`](https://togithub.com/PHP-CS-Fixer/shim/compare/v3.40.2...v3.41.0) [Compare Source](https://togithub.com/PHP-CS-Fixer/shim/compare/v3.40.2...v3.41.0) </details> <details> <summary>phpstan/phpstan (phpstan/phpstan)</summary> ### [`v1.10.48`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.48) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.47...1.10.48) # Bleeding edge 🔪 - TooWideMethodReturnTypehintRule - always report for final methods (phpstan/phpstan-src@c30e9a4) - LogicalXorConstantConditionRule (phpstan/phpstan-src@3a12724, phpstan/phpstan-src@3b011f6), [#​7539](https://togithub.com/phpstan/phpstan/issues/7539) - NoopRule - report top-level `xor` because that's probably not what the user intended to do (phpstan/phpstan-src@a1fffb3), [#​10267](https://togithub.com/phpstan/phpstan/issues/10267) - Report unused results of `and` and `or` (phpstan/phpstan-src@1d8fff6) - Report unused result of ternary (phpstan/phpstan-src@9664f7a) - Report unused results of `&&` and `||` (phpstan/phpstan-src@cf2c8bb) *If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's `phpstan.neon`:* includes: - vendor/phpstan/phpstan/conf/bleedingEdge.neon *Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. [Learn more](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Narrow `ReflectionEnum::getName()` after `ReflectionEnum::isBacked()` ([#​2806](https://togithub.com/phpstan/phpstan-src/pull/2806)), [#​10192](https://togithub.com/phpstan/phpstan/issues/10192), thanks [@​franmomu](https://togithub.com/franmomu)! - Any variable can exist after include/require (phpstan/phpstan-src@0a3a968), [https://github.com/phpstan/phpstan/discussions/10252](https://togithub.com/phpstan/phpstan/discussions/10252) # Bugfixes 🐛 - ResolvedPhpDocBlock: fix parent return tag merging ([#​2803](https://togithub.com/phpstan/phpstan-src/pull/2803)), [#​6462](https://togithub.com/phpstan/phpstan/issues/6462), [#​10208](https://togithub.com/phpstan/phpstan/issues/10208), [#​3580](https://togithub.com/phpstan/phpstan/issues/3580), [#​4396](https://togithub.com/phpstan/phpstan/issues/4396), thanks [@​janedbal](https://togithub.com/janedbal)! - Merge in-foreach scope even for non-iterable expr (phpstan/phpstan-src@942afbf) - TooWideMethodReturnTypehintRule - never report in a trait (phpstan/phpstan-src@e0eb850) - Narrowing list type with `count()` results in type loss ([#​2811](https://togithub.com/phpstan/phpstan-src/pull/2811)), [#​10264](https://togithub.com/phpstan/phpstan/issues/10264), thanks [@​staabm](https://togithub.com/staabm)! - Fix LevelsTestCase for PHPUnit 10 (phpstan/phpstan-src@fa5d5f9) # Function signature fixes 🤖 - Update return type information for `SimpleXMLElement::addChild` ([#​2808](https://togithub.com/phpstan/phpstan-src/pull/2808)), [#​10269](https://togithub.com/phpstan/phpstan/issues/10269), thanks [@​DaveLiddament](https://togithub.com/DaveLiddament)! </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Lendable/clock). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44Ny4yIiwidXBkYXRlZEluVmVyIjoiMzcuODcuMiIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR: