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

Add support for PHPUnit 11 #4477

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

MauricioFauth
Copy link
Contributor

This is my last attempt to add support for PHPUnit 11 for Twig 3.

This pull request adds new test methods that only runs in PHPUnit >= 11 and makes the current test methods to only run with PHPUnit < 11.

I think this addresses the @stof concerns about BC break, as the there's no change for PHPUnit < 11 besides the skipped tests that requires PHPUnit >= 11, but no test is actually skipped as they all run with the test methods that requires PHPUnit < 11.

Running on PHPUnit 11 requires Twig\Test\NodeTestCase::provideTests() and Twig\Test\IntegrationTestCase::getFixturesDirectory() to be implemented.
So it's recommended to first fix the deprecations with PHPUnit 10 before running the tests with PHPUnit 11, or the tests will fail.

Adds new tests that only runs in PHPUnit >= 11 and makes the current
tests to only run with PHPUnit < 11.

Running on PHPUnit 11 requires Twig\Test\NodeTestCase::provideTests()
and Twig\Test\IntegrationTestCase::getFixturesDirectory() to be
implemented.
@MauricioFauth
Copy link
Contributor Author

A note about this change that I forgot to mention, it will only work for PHPUnit >= 11.4.0 as I had to fix it in PHPUnit first to make this PR work. The patch was included in PHPUnit 10.5.36 as well, however this PR does not affect users with PHPUnit < 10.5.36 and only those who try to run the tests with PHPUnit 11.

@derrabus
Copy link
Contributor

Note that the 4.x branch should already be compatible with PHPUnit 11. Not sure how long it'll take to push Twig 4 over the finish line, but can't we live with PHPUnit 10 until then?

@MauricioFauth
Copy link
Contributor Author

Note that the 4.x branch should already be compatible with PHPUnit 11. Not sure how long it'll take to push Twig 4 over the finish line, but can't we live with PHPUnit 10 until then?

As this patch has no impact on current users (no BC break), it will make easier to users to upgrade to Twig 4. And Twig will be compatible with PHPUnit 11 right now instead of waiting for Twig 4.
And PHPUnit 11 is almost one year old already and PHPUnit 12 is due by February 07, 2025.

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.

2 participants