Skip to content

[PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION #38305

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

Merged
merged 1 commit into from
Sep 26, 2020
Merged

[PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION #38305

merged 1 commit into from
Sep 26, 2020

Conversation

stevegrunwell
Copy link
Contributor

@stevegrunwell stevegrunwell commented Sep 25, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets none
License MIT
Doc PR symfony/symfony-docs#14286

This PR adds support for the SYMFONY_MAX_PHPUNIT_VERSION environment variable, letting users set the maximum version of PHPUnit to be considered when running the PHPUnit Bridge.

The use case here comes from testing WordPress using the library; as of the time of this ticket, WordPress' core test suite does not yet support PHPUnit 8.x. As a result, trying to run the WordPress core test suite with PHPUnit Bridge results in the following error under PHP 7.2 or newer:

Error: Looks like you're using PHPUnit 8.3.5. WordPress requires at least PHPUnit 5.4 and is currently only compatible with PHPUnit up to 7.x.
Please use the latest PHPUnit version from the 7.x branch.

In this use case, the developer testing against WordPress would set SYMFONY_MAX_PHPUNIT_VERSION=7.5 in their environment (or phpunit.xml file) and the PHPUnit Bridge would never go above that version (but would still be free to, for instance, load PHPUnit 6 when running under PHP 7.0).

@fabpot
Copy link
Member

fabpot commented Sep 26, 2020

Thank you @stevegrunwell.

@fabpot fabpot merged commit 02d879f into symfony:master Sep 26, 2020
wouterj added a commit to symfony/symfony-docs that referenced this pull request Oct 3, 2020
…ariable (stevegrunwell)

This PR was merged into the master branch.

Discussion
----------

Document the SYMFONY_MAX_PHPUNIT_VERSION environment variable

This documentation corresponds with symfony/symfony#38305.

Commits
-------

517cbc0 Document the SYMFONY_MAX_PHPUNIT_VERSION environment variable
@fabpot fabpot mentioned this pull request Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants