Skip to content

Add support for PHPUnit 11#4317

Closed
MauricioFauth wants to merge 2 commits into
twigphp:3.xfrom
MauricioFauth:phpunit-11-compat
Closed

Add support for PHPUnit 11#4317
MauricioFauth wants to merge 2 commits into
twigphp:3.xfrom
MauricioFauth:phpunit-11-compat

Conversation

@MauricioFauth

@MauricioFauth MauricioFauth commented Sep 13, 2024

Copy link
Copy Markdown
Contributor

The test cases Twig\Test\NodeTestCase and Twig\Test\IntegrationTestCase are currently incompatible with PHPUnit 11.

This pull request adds an option to the user to add support to run the tests with PHPUnit 11, if they implement the Twig\Test\IntegrationTestCase::getFixturesDirectory() method. Currently the only solution to the user is to fork IntegrationTestCase and NodeTestCase test cases, and run them only for PHPUnit 11.

The difference from the previous pull request is that this time, if getFixturesDirectory() is not implemented, it does not run the tests and trigger a deprecation, instead of causing an error.

- Adds static data providers for Twig\Test\IntegrationTestCase. Running
  PHPUnit 10+ will require
  Twig\Test\IntegrationTestCase::getFixturesDirectory() to be
  implemented.
- Removes the Twig\Test\NodeTestCase::getTests() data provider from the
  DataProvider attribute. This way it doesn't get called with
  PHPUnit 10+ causing the tests to fail.

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
@fabpot

fabpot commented Oct 7, 2024

Copy link
Copy Markdown
Contributor

I'm closing here as the work to support PHPUnit 11 has been done in Twig 4.0.

@fabpot fabpot closed this Oct 7, 2024
@MauricioFauth MauricioFauth deleted the phpunit-11-compat branch November 10, 2024 06:25
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