-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Created new Mutator for strtoupper function #535
Conversation
…ion#523) * Restrict installation with broken versions of symfony/console Also ignore bogus PHPStan warnings. * Update TestFrameworkFinder to always look for a .bat first. (infection#506) * Update TestFrameworkFinder to always look for a .bat first. Fixes infection#503 * Phpunit_Bat_Wrapper: add cwd to path just for this test * Phpunit_Bat_Wrapper: it does not matter if Infection succeeds, only it must find phpunit.bat
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.
Thanks for creating this PR. There are some copy-paste errors, besides that looks good
<<<'PHP' | ||
<?php | ||
|
||
function array_flip($text) |
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.
it should be function strtoupper
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.
@borNfreee @zf2timo
Ha, made the same mistake a couple of times! 🤓
PHP | ||
]; | ||
|
||
yield 'It does not mutate functions named array_flip' => [ |
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.
array_flip
-> strtoupper
<<<'PHP' | ||
<?php | ||
|
||
$a = strtoupper(['A', 1, 'C']); |
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 suggest using string, not an array for all these examples, because strtoupper
works with strings ;)
PHP | ||
]; | ||
|
||
yield 'It mutates correctly when array_flip is wrongly capitalized' => [ |
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.
array_flip
-> strtoupper
PHP | ||
]; | ||
|
||
yield 'It mutates correctly when array_flip uses another function as input' => [ |
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.
array_flip
-> strtoupper
* Enhancement: Enable no_superfluous_phpdoc_tags fixer * Fix: Run php-cs-fixer * Fix: Remove useless DocBlocks
…ection#519) * Run project's tests in a random order for InitialTestRun process if it's possible * Run project's tests in a random order for PHPUnit 7.2+ * Remove config.platform.php=7.0 from e2e tests. Add PHPUnit's cache file to .gitignore * Do not update executionOrder if it is set in phpunit.xml * Improve exception message to inform users about how to not allow Infection randomize tests * Add e2e test to ensure Infection does not try to randomize tests execution order when `phpunit.xml` contains `executeOrder="XXX"`
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.
Also, this needs to be rebased to use a new approach with yield
, see
yield 0; |
for an example.
@zf2timo are you going to finish this one or can we take over it? I'm planning a release soon, want to get this merged before it is published
# Conflicts: # composer.lock # devTools/phpstan-src.neon
* Enhancement: Assert that mutators in mutator profile constants are sorted by name * Fix: Keep mutators in mutator profiles sorted by name
@borNfreee Sorry for the delay. I was an a small vacation. |
…ion into feature/unwrap-strtoupper
The function name being variable caused issues in other mutators before So we want to make sure it doesn't happen for the unwrap mutators
…ion into feature/unwrap-strtoupper
Ha, looks like something went wrong with the rebase. |
@localheinz yes, this looks bad. @borNfreee maybe I create a new PR? |
Yeah, let's do it |
Closed by #551 |
This PR:
UnwrapStrToUpper
as suggested in New @unwrap mutators ideas #514