Skip to content

[PHPUnitBridge] Add an example for SYMFONY_PHPUNIT_REQUIRE #17968

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions components/phpunit_bridge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -938,18 +938,27 @@ If you have installed the bridge through Composer, you can run it by calling e.g
then set the ``SYMFONY_PHPUNIT_REMOVE`` env var to ``symfony/yaml``.

It's also possible to set this env var in the ``phpunit.xml.dist`` file.

.. tip::

It is also possible to require additional packages that will be installed along
the rest of the needed PHPUnit packages using the ``SYMFONY_PHPUNIT_REQUIRE``
with the rest of the needed PHPUnit packages using the ``SYMFONY_PHPUNIT_REQUIRE``
env variable. This is specially useful for installing PHPUnit plugins without
having to add them to your main ``composer.json`` file.
having to add them to your main ``composer.json`` file. The required packages
need to be separated with a space.

.. versionadded:: 5.3
.. code-block:: xml

<!-- phpunit.xml.dist -->
<!-- ... -->
<php>
<env name="SYMFONY_PHPUNIT_REQUIRE" value="vendor/name:^1.2 vendor/name2:^3"/>
</php>

.. versionadded:: 5.3

The ``SYMFONY_PHPUNIT_REQUIRE`` env variable was introduced in
Symfony 5.3.
The ``SYMFONY_PHPUNIT_REQUIRE`` env variable was introduced in
Symfony 5.3.

Code Coverage Listener
----------------------
Expand Down