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
Fix issue with order of keys in the config array #1410
Conversation
… case when profile setting is higher than mutator setting in the Infection configuration file
@@ -15,6 +15,7 @@ parameters: | |||
- '#^Cannot call method (willReturn|shouldBeCalledTimes)\(\) on iterable<Infection\\Mutation\\Mutation>\.$#' | |||
- '#Offset .*\\.* does not exist on array<class-string<.*>.*#' | |||
- '#Dynamic call to static method PHPUnit\\Framework\\Assert::(.*)#' | |||
- '#Call to method PHPUnit\\Framework\\Assert::.* with array.* and array.* will always evaluate to false#' |
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.
For these:
./vendor/bin/phpstan analyse --configuration devTools/phpstan-tests.neon --no-interaction --no-progress
------ ----------------------------------------------------------
Line Mutator/MutatorResolverTest.php
------ ----------------------------------------------------------
348 Call to method PHPUnit\Framework\Assert::assertSame() with array('Infection\\Mutator\\Number\\DecrementInteger' => array('ignore' => array('Infected…')), 'Infection\\Mutator\\Number\\IncrementInteger' => array(),
'Infection\\Mutator\\Number\\OneZeroFloat' => array(), 'Infection\\Mutator\\Number\\OneZeroInteger' => array()) and array<class-string<Infection\Mutator\ConfigurableMutator>, array<string, mixed>> will always evaluate to false.
377 Call to method PHPUnit\Framework\Assert::assertSame() with array('Infection\\Mutator\\Number\\DecrementInteger' => array('ignore' => array('Infected…')), 'Infection\\Mutator\\Number\\IncrementInteger' => array(),
'Infection\\Mutator\\Number\\OneZeroFloat' => array(), 'Infection\\Mutator\\Number\\OneZeroInteger' => array()) and array<class-string<Infection\Mutator\ConfigurableMutator>, array<string, mixed>> will always evaluate to false.
------ ----------------------------------------------------------
I wish I knew why PHPStan thinks this stands true.
]); | ||
|
||
$this->assertSame( | ||
[ |
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.
I thought about more generic way to build expected result otherwise we will need to fix this test each time when we add new mutator to the @number
profile (do not expect that it may happen often).
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.
Yeah, it should be possible to make this test a little less brittle, but it'll cost in visibility which I think isn't worth it right now.
Thank you @sidz and @maks-rafalko |
* Add test that profile settings override particular mutator setting in case when profile setting is higher than mutator setting in the Infection configuration file * Fix #1408 * Fix issue where both mutator and profile have settings Co-authored-by: Oleg Zhulnev <plbsid@gmail.com>
This PR is a follow-up to #1409:
mutators
config array, leads to different results #1408