Skip to content

Add void to generated setUp() in tests too, as in real runs - #858

Merged
TomasVotruba merged 1 commit into
mainfrom
setup-method-void-outside-phpunit
Dec 2, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
setup-method-void-outside-phpunit

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

SetUpMethodDecorator returned early when PHPUnit was running, so ConstructClassMethodToSetUpTestCaseRector fixtures showed setUp() without : void, while a real run adds it.

The skip is removed. The return type is still copied from the installed PHPUnit\Framework\TestCase::setUp(), so projects on old PHPUnit without void keep getting none - that check reads the same in tests and in real runs. The 2 affected fixtures now show : void.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant