Prepare IntegrationTestCase for static data providers#4266
Merged
fabpot merged 1 commit intoSep 3, 2024
Conversation
Contributor
Author
|
The failures in the extra packages happen because we pull a version of Twig as dependency that does not include my changes. How do we deal with this kind of failure on this repo? |
Member
|
@derrabus accept it for now, as it will be resolved after the merge-up in the 4.x branch. |
stof
suggested changes
Sep 3, 2024
ae35b7a to
a57f35e
Compare
Contributor
|
Having PHPUnit 11 support only in 4.0 sounds good to me. |
a57f35e to
18f4203
Compare
Contributor
|
Thank you @derrabus. |
Contributor
|
The documentation example is missing an update https://github.com/twigphp/Twig/blob/4.x/doc/advanced.rst#testing-an-extension |
williamdes
reviewed
Jan 10, 2025
| instead, which will be abstract in 4.0. | ||
|
|
||
| * The data providers ``getTests()`` and ``getLegacyTests()`` on | ||
| ``Twig\Test\IntegrationTestCase`` are considered final als of Twig 3.13. |
Contributor
|
@williamdes Would you like to open a PR to improve documentation? |
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
Update: I am trying to cleanup my TODO lists. I will not be the one making the doc update :/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Data providers need to be static in PHPUnit 11. Because of this, I'd like to declare the two methods we use as data providers in
IntegrationTestCaseas static in 4.0. This PR prepares that change:getFixturesDir()method is replaced with a staticgetFixturesDirectory().getTests()andgetLegacyTests()are marked as final, so we can declare them static in the next major.This however means that we're delaying PHPUnit 11 compatibility of integration tests to Twig 4.0. If that's too late for us, we could deprecate the whole
IntegrationTestCasein favor of a compatible replacement. That's a bigger change, but I would work on it if you think it's worth it.