[CodeQuality] Rule to enforce test method code style#668
[CodeQuality] Rule to enforce test method code style#668Xammie wants to merge 2 commits intorectorphp:mainfrom
Conversation
|
@TomasVotruba this is ready to review :) |
| if (! $this->testsNodeAnalyzer->isTestClassMethod($node)) { | ||
| return null; | ||
| } | ||
|
|
There was a problem hiding this comment.
here ensure name is exists first before changing it, you can use Class_ instead of ClassMethod, and verify from $class->getMethod() or classReflection->hasMethod()
|
for additional note: I think this should be your own custom rule for your specific use case :) |
|
@samsonasik thank you for the review. Regarding your additional note, do you mean this should not be part of rector php and instead be part of a separate package? |
|
yeah, imo, this should be not part of rector repo, you can create your own custom rector rule for it as this is by preference |
|
The reason I thought it would fit well here is because this is similar to Ofcourse if you still don't think this should be part of |
This adds two rules to convert the name of test methods to either
CamelCaseorsnake_case.