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

Update PHPUnit 10 #998

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Update PHPUnit 10 #998

wants to merge 11 commits into from

Conversation

jorgsowa
Copy link
Contributor

@jorgsowa jorgsowa commented May 13, 2024

Updates PHPUnit version to 10.

  • migrated PHPUnit configuration to v10 and left old configuration as phpunit.xml.9.5.dist
  • modified GitHub actions to run proper PHPUnit configuration depending on the PHP version
  • declared all data providers as static,
  • added PHPUnit version ^10.0 in Composer,
  • added PHPUnit 10 cache dir to .gitignore,

@nikic
Copy link
Owner

nikic commented May 21, 2024

migrated PHPUnit configuration to v10 and left old configuration as phpunit.xml.9.5.dist

Is this necessary? Doesn't PHPUnit automatically migrate the old config?

@jorgsowa
Copy link
Contributor Author

Is this necessary? Doesn't PHPUnit automatically migrate the old config?

XML of PHPUnit v10 is not compatible with XML of PHPUnit v9. Joining it with strictness of warnings it's not possible to use the same PHPUnit configuration file for both versions of 9 and 10.

Example of failing test with PHPUnit 10 but with elements of XML from PHPUnit 9: https://github.com/nikic/PHP-Parser/actions/runs/9086446408/job/24979454495?pr=998

The idea I came up with is to have simply two configuration files for each PHPUnit version. The other solution would be to upgrade completely to PHPUnit 10, but it would require bumping min. PHP version to 8.1 which is not desired for now.

@nikic
Copy link
Owner

nikic commented May 25, 2024

I think overall I'm not clear on what the benefit of using PHPUnit 10 on some versions and PHPUnit 9 on some is. This just seems to increase complexity, as we wouldn't be able to use any new functionality from PHPUnit 10 anyway. If it "just worked", that would be one thing, but apparently it doesn't...

(I think merging just the data provide changes would make sense though, in the interest of forward-compatibility.)

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.

None yet

2 participants