[PHPUnit 10] Rename assertObjectHasAttribute() to assertObjectHasProperty(), add AssertIssetToAssertObjectHasPropertyRector#338
Merged
TomasVotruba merged 6 commits intomainfrom Jun 22, 2024
Conversation
89c5949 to
87ece0d
Compare
1e207dd to
4d06c8a
Compare
3f83aab to
0dcfb32
Compare
0dcfb32 to
6557da6
Compare
Member
|
@TomasVotruba I tried in CodeIgniter4 project,it got error: undefined It uses PHPUnit 10.5.24 Looking on the repo, it seems there is no method named |
samsonasik
reviewed
Jun 22, 2024
|
|
||
| // https://github.com/sebastianbergmann/phpunit/issues/5220 | ||
| new MethodCallRename('PHPUnit\Framework\Assert', 'assertObjectHasAttribute', 'assertObjectHasProperty'), | ||
| new MethodCallRename('PHPUnit\Framework\Assert', 'assertObjectNotHasAttribute', 'assertObjectHasNotProperty'), |
Member
There was a problem hiding this comment.
the method seems should be assertObjectNotHasProperty, see https://github.com/sebastianbergmann/phpunit/blob/bb24b2746512bc8be5122bb220064df8f8687451/src/Framework/Assert.php#L1052C34-L1052C60
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PHPUnit 10 removed
assertObjectHasAttribute(), with no replacement.Then PHPUnit 10.1 introduced
assertObjectHasProperty()as 1:1 replacement.Instead of migrating methods twice back and forth, we'll simple rename it.
See sebastianbergmann/phpunit#5220
Closes https://github.com/rectorphp/rector-phpunit/issues/336