Skip to content

PHPUnit 11 compatibility#1766

Merged
GromNaN merged 1 commit into
symfony:1.xfrom
GromNaN:phpunit-11
Feb 12, 2026
Merged

PHPUnit 11 compatibility#1766
GromNaN merged 1 commit into
symfony:1.xfrom
GromNaN:phpunit-11

Conversation

@GromNaN
Copy link
Copy Markdown
Member

@GromNaN GromNaN commented Jan 7, 2026

  • Run tests with PHPUnit 11
  • Add PHPUnit attributes, in addition to annotations

Making all the data providers static require to make many other methods static in the tests directory.

The main point is the MakerTestCase that is part of the API and is extended in other projects. Creating a new class is the only way to change abstract methods from non-static to static in a BC way.

Comment thread src/Test/AbstractMakerTestCase.php Outdated
@GromNaN GromNaN force-pushed the phpunit-11 branch 4 times, most recently from 886e9de to 9ef2746 Compare January 9, 2026 22:56
use Symfony\Component\Process\Process;

/**
* @method static iterable<array{0: MakerTestDetails}> getTestDetails()
Copy link
Copy Markdown
Member Author

@GromNaN GromNaN Jan 9, 2026

Choose a reason for hiding this comment

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

By removing the abstract method declaration, moved to a PHPDoc, I avoid the breaking change.
We have to be careful to not add the abstract static method declaration in 1.x, but only in 2.x.

Comment thread src/Test/MakerTestCase.php Outdated
Comment thread src/Test/MakerTestCase.php Outdated
Comment thread src/Test/AbstractMakerTestCase.php Outdated
Comment thread src/Test/MakerTestCase.php Outdated
Comment thread src/Test/MakerTestCase.php Outdated
Comment thread src/Test/MakerTestCase.php Outdated
@GromNaN GromNaN requested a review from stof January 20, 2026 10:50
@GromNaN GromNaN force-pushed the phpunit-11 branch 3 times, most recently from 2ac6adf to 6ea7eca Compare February 10, 2026 14:44
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