Skip to content

Document the SYMFONY_MAX_PHPUNIT_VERSION environment variable #14286

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
Oct 3, 2020
Merged

Document the SYMFONY_MAX_PHPUNIT_VERSION environment variable #14286

merged 1 commit into from
Oct 3, 2020

Conversation

stevegrunwell
Copy link
Contributor

This documentation corresponds with symfony/symfony#38305.

fabpot added a commit to symfony/symfony that referenced this pull request Sep 26, 2020
… set via SYMFONY_MAX_PHPUNIT_VERSION (stevegrunwell)

This PR was merged into the 5.2-dev branch.

Discussion
----------

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

| 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](https://core.trac.wordpress.org/ticket/46149). 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).

Commits
-------

7877a5b [PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION
@wouterj wouterj added this to the 5.2 milestone Oct 3, 2020
wouterj added a commit that referenced this pull request Oct 3, 2020
@wouterj wouterj merged commit d8d96ca into symfony:master Oct 3, 2020
@wouterj
Copy link
Member

wouterj commented Oct 3, 2020

Thank you @stevegrunwell for providing a documentation update for your feature!

@stevegrunwell stevegrunwell deleted the phpunit-bridge/max-phpunit-version branch October 3, 2020 17:07
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.

3 participants