Skip to content

[PhpUnitBridge] Add SYMFONY_PHPUNIT_REQUIRE env variable #40059

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
Feb 5, 2021

Conversation

acasademont
Copy link
Contributor

@acasademont acasademont commented Feb 1, 2021

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #39387
License MIT
Doc PR symfony/symfony-docs#14913

As discussed on #39387, this PR adds a new SYMFONY_PHPUNIT_REQUIRE env variable to add packages to the phpunit bridge installation. This is useful for adding phpunit plugins (ie: https://github.com/phpspec/prophecy-phpunit) without having to add them directly to the main app composer.json.

On my phpunit.xml.dist file I can now add

<server name="SYMFONY_PHPUNIT_REQUIRE" value="phpspec/prophecy-phpunit"/>

And the phpspec/prophecy-phpunit will be installed along the rest of the phpunit packages

@acasademont
Copy link
Contributor Author

The fabbot seems to be complaining about an unrelated line. Can fix it if necessary!

@OskarStark
Copy link
Contributor

OskarStark commented Feb 2, 2021

So if I understand this right, I can also require a specific version?

<server name="SYMFONY_PHPUNIT_REQUIRE" value="phpspec/prophecy-phpunit:^1.0"/>

@acasademont
Copy link
Contributor Author

So if I understand this right, I can also require a specific version?

<server name="SYMFONY_PHPUNIT_REQUIRE" value="phpspec/prophecy-phpunit:^1.0"/>

Yes exactly!

@fabpot
Copy link
Member

fabpot commented Feb 5, 2021

Thank you @acasademont.

@fabpot fabpot merged commit 1adfede into symfony:5.x Feb 5, 2021
@acasademont acasademont deleted the phpunit_require branch February 5, 2021 08:07
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Feb 8, 2021
…IT_REQUIRE env variable (acasademont)

This PR was merged into the 5.3-dev branch.

Discussion
----------

[Testing] [PHPUnitBridge] Docs for the new SYMFONY_PHPUNIT_REQUIRE env variable

Code PR: symfony/symfony#40059

Commits
-------

79a2112 Docs for the new SYMFONY_PHPUNIT_REQUIRE env variable
@fabpot fabpot mentioned this pull request Apr 18, 2021
@alexander-schranz
Copy link
Contributor

Was searching today if this is even possible and found then this new variable @acasademont Thank you for this 👍

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.

[PhpUnitBridge] Enable Prophecy integration via env variable
6 participants