Skip to content

Recommend to use PHPUnitBridge instead of PHPUnit #8883

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion setup/bundles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ PHPUnit test report:

.. code-block:: terminal
$ phpunit
# this command is available after running "composer require --dev symfony/phpunit-bridge"
$ ./bin/phpunit
# ... PHPUnit output
Expand Down
3 changes: 2 additions & 1 deletion setup/upgrade_major.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ Now, you can start fixing the notices:

.. code-block:: text

$ phpunit
# this command is available after running "composer require --dev symfony/phpunit-bridge"
$ ./bin/phpunit
...

OK (10 tests, 20 assertions)
Expand Down
21 changes: 9 additions & 12 deletions testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ Symfony integrates with an independent library - called PHPUnit - to give
you a rich testing framework. This article won't cover PHPUnit itself, but
it has its own excellent `documentation`_.

.. note::
First, install PHPUnit support in your Symfony application running this command:

.. code-block:: terminal

It's recommended to use the latest stable PHPUnit version, `installed as
PHAR`_.
$ composer require --dev phpunit

Each test - whether it's a unit test or a functional test - is a PHP class
that should live in the ``tests/`` directory of your application. If you follow
Expand All @@ -27,7 +28,7 @@ command:

.. code-block:: terminal

$ phpunit
$ ./bin/phpunit

PHPUnit is configured by the ``phpunit.xml.dist`` file in the root of your
Symfony application.
Expand Down Expand Up @@ -99,16 +100,13 @@ Running tests for a given file or directory is also very easy:
.. code-block:: terminal

# run all tests of the application
$ phpunit
$ ./bin/phpunit

# run all tests in the Util directory
$ phpunit tests/Util
# run all tests in the Util/ directory
$ ./bin/phpunit tests/Util

# run tests for the Calculator class
$ phpunit tests/Util/CalculatorTest.php

# run all tests for the entire Bundle
$ phpunit tests/
$ ./bin/phpunit tests/Util/CalculatorTest.php

.. index::
single: Tests; Functional tests
Expand Down Expand Up @@ -920,4 +918,3 @@ Learn more

.. _`$_SERVER`: http://php.net/manual/en/reserved.variables.server.php
.. _`documentation`: https://phpunit.de/manual/current/en/
.. _`installed as PHAR`: https://phpunit.de/manual/current/en/installation.html#installation.phar