Skip to content

Conversation

@gnutix
Copy link
Contributor

@gnutix gnutix commented Feb 28, 2020

Could not reproduce in a demo set however ('guessing because there's no real PHPUnit in there) : https://getrector.org/demo/011085dd-1266-4a33-a8a9-44e355f9f709#result

Fails with error :

 [ERROR] Could not process "File.php" file, due to:     
         "Pick more specific node than "PhpParser\Node\Expr\StaticCall"".                                                                        

I had the exact same error happen from these Rectors on my code base :

  • Rector\PHPUnit\Rector\SpecificMethod\AssertTrueFalseToSpecificMethodRector
  • Rector\PHPUnit\Rector\SpecificMethod\AssertFalseStrposToContainsRector
  • Rector\PHPUnit\Rector\SpecificMethod\AssertPropertyExistsRector

I guess the issue is the same, so I won't try to add tests for them all. We'll see later once a fix comes out if they still fail.

@gnutix gnutix changed the title AssertRegExpRectorTest: add broken test when calling static method. AssertRegExpRectorTest: add broken test on static method call Feb 28, 2020
@TomasVotruba
Copy link
Member

Same as previous PR

@TomasVotruba TomasVotruba merged commit 51b379b into rectorphp:master Feb 29, 2020
@TomasVotruba TomasVotruba deleted the AssertRegExpRectorTest/add-broken-test-static-method-call branch February 29, 2020 00:13
@gnutix
Copy link
Contributor Author

gnutix commented Mar 3, 2020

There is still the same issue on my code base with these two Rectors :

  • Rector\PHPUnit\Rector\SpecificMethod\AssertFalseStrposToContainsRector
  • Rector\PHPUnit\Rector\SpecificMethod\AssertPropertyExistsRector

@TomasVotruba
Copy link
Member

Possibly similar solution might be applied. Look at stack trace, before going into getName()

TomasVotruba added a commit that referenced this pull request Sep 24, 2022
rectorphp/rector-src@429c9c0 [Php81] Handle crash insensitive function name on NullToStrictStringFuncCallArgRector (#2953)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants