Skip to content

[RemoveTestSuffixFromAbstractTestClassesRector] Add new rule (#132)#141

Closed
JohJohan wants to merge 1 commit intorectorphp:mainfrom
JohJohan:RemoveTestSuffixFromAbstractTestClassesRector
Closed

[RemoveTestSuffixFromAbstractTestClassesRector] Add new rule (#132)#141
JohJohan wants to merge 1 commit intorectorphp:mainfrom
JohJohan:RemoveTestSuffixFromAbstractTestClassesRector

Conversation

@JohJohan
Copy link
Copy Markdown
Contributor

@JohJohan JohJohan commented Jan 5, 2023

$classShortName = $this->nodeNameResolver->getShortName($className);
// no match → rename file
$newFileLocation = dirname($filePath) . DIRECTORY_SEPARATOR . $classShortName . 'Case.php';
$this->removedAndAddedFilesCollector->addMovedFile($this->file, $newFileLocation);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way i can use RenameClassRector to rename the class/file here?


private function getPhpUnitDirectorySuffix(): string
{
// TODO check in phpunit config if this is different.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there example on how i can read the phpunit config file?

@ghost
Copy link
Copy Markdown

ghost commented Jan 9, 2023

@samsonasik if you have time could you give me some hits for #141 (comment) & #141 (comment)

@ghost
Copy link
Copy Markdown

ghost commented Jan 11, 2023

@samsonasik if you have time could you give me some hits for #141 (comment) & #141 (comment)

@samsonasik sorry to bother you, but if you have time could you help me out or is there someone else you know who can help me out?

@TomasVotruba
Copy link
Copy Markdown
Member

I'll give this a priority today 👍
Sorry for keeping you waiting, we were trying to handle all the custom PHPUnit 10 annotaiton to attribute changes.

@TomasVotruba
Copy link
Copy Markdown
Member

Continues in #151

Thanks for the kick off 🥳

@JohJohan JohJohan deleted the RemoveTestSuffixFromAbstractTestClassesRector branch February 8, 2023 09:47
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.

[PHPUnit 10] Abstract test classes cannot use *Test suffix

2 participants