-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add PropertyExistsWithoutAssertRector #158
Conversation
Removes the now deprecated property/method exists PHPUnit assertions and replaces them with plain PHP equivalents.
I'll look into this, thank you 👍 |
Rebased and merged in #202 |
Hey @TomasVotruba I guess this rule should be introduced in phpunit 9 rules instead of 10, don't you? |
Hey, the PHPUnit 10 is fine here as that's where the change happens. See milestone in: sebastianbergmann/phpunit#4601 The idea is that after running PHPUNIT_100 set, the code should run on PHPUnit 10. |
But I can not run my pipelines are failing when I add deprecated methods :( the same thing for https://github.com/rectorphp/rector-phpunit/blob/main/docs/rector_rules_overview.md#addprophecytraitrector |
well I made this work adding $rectorConfig->rule(PropertyExistsWithoutAssertRector::class);
$rectorConfig->rule(AddProphecyTraitRector::class); But if it's in version 9, I could avoid search about those 2 rules. |
You can run What exact error are you getting? |
I saw that it is applying php 8 code, and I'm still on php 7.4 :'(
|
before ->withConsecutive(...$expectedSleepValues); after ->willReturnCallback(function () use ($matcher) {
return match ($matcher->numberOfInvocations()) {
1 => $expectedSleepValues,
};
}); |
Ok it's the issue this rule is applying php 8 code Should we downgrade this code to |
That's the pain point. Perfect! This rule should run only on PHP 8 indeed.
That's not necessary. The Instead, this rule should implement |
Yep, I will open a PR ;) |
Removes the now deprecated property/method exists PHPUnit assertions and replaces them with plain PHP equivalents. This is the inverse of AssertPropertyExistsRector.php to account for their removal in PHPUnit v10.