Skip to content
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

[Phpunit] Some rectors throw exception when encountering method calls #5797

Closed
Bl00D4NGEL opened this issue Mar 8, 2021 · 0 comments · Fixed by #5798
Closed

[Phpunit] Some rectors throw exception when encountering method calls #5797

Bl00D4NGEL opened this issue Mar 8, 2021 · 0 comments · Fixed by #5798
Labels

Comments

@Bl00D4NGEL
Copy link
Contributor

Bug Report

Subject Details
Rector version Rector 0.9.29
Installed as prefixed Rector

A few phpunit rectors do not seem to be able to handle method calls and instead throw an \Rector\Core\Exception\ShouldNotHappenException with the message Name called on "PhpParser\Node\Expr\MethodCall" is not possible. Use $this->getName($node->name) instead
These include but may not be limited to:

  • AssertTrueFalseToSpecificMethodRector
  • AssertFalseStrposToContainsRector
  • AssertPropertyExistsRector

Minimal PHP Code Causing Issue

https://getrector.org/demo/e3abd896-bd98-4f5a-ad71-dc097a1cbdd3

Expected Behaviour

The rector does not throw an exception and also does not change the code (similar to how the named rectors already skip static methods)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant