@@ -15,35 +15,29 @@ Symfony integrates with an independent library called `PHPUnit`_ to give you a
15
15
rich testing framework. This article won't cover PHPUnit itself, which has its
16
16
own excellent `documentation `_.
17
17
18
- Before creating your first test, install the `PHPUnit Bridge component `_, which
19
- wraps the original PHPUnit binary to provide additional features:
18
+ Before creating your first test, install the PHPUnit with the following command:
20
19
21
20
.. code-block :: terminal
22
21
23
- $ composer require --dev symfony /phpunit-bridge
22
+ $ composer require --dev phpunit /phpunit
24
23
25
- After the library downloads, try executing PHPUnit by running (the first time
26
- you run this, it will download PHPUnit itself and make its classes available in
27
- your app):
24
+ After the library is installed, try executing PHPUnit by running:
28
25
29
26
.. code-block :: terminal
30
27
31
- $ ./bin/phpunit
28
+ $ ./vendor/ bin/phpunit
32
29
33
30
.. note ::
34
31
35
- The ``./bin/phpunit `` command is created by :ref: `Symfony Flex <symfony-flex >`
36
- when installing the ``phpunit-bridge `` package. If the command is missing, you
37
- can remove the package (``composer remove symfony/phpunit-bridge ``) and install
38
- it again. Another solution is to remove the project's ``symfony.lock `` file and
39
- run ``composer install `` to force the execution of all Symfony Flex recipes.
32
+ :ref: `Symfony Flex <symfony-flex >` has automatically created ``phpunit.xml.dist ``
33
+ and ``tests/bootstrap.php ``. If the files are missing, you can remove the package
34
+ (``composer remove phpunit/phpunit ``) and install it again.
40
35
41
36
Each test is a PHP class that should live in the ``tests/ `` directory of
42
37
your application. If you follow this rule, then you can run all of your
43
38
application's tests with the same command as before.
44
39
45
- PHPUnit is configured by the ``phpunit.xml.dist `` file in the root of your
46
- Symfony application.
40
+ PHPUnit is configured by the ``phpunit.xml.dist `` file in the root of your application.
47
41
48
42
.. tip ::
49
43
@@ -1030,7 +1024,6 @@ Learn more
1030
1024
1031
1025
.. _`PHPUnit` : https://phpunit.de/
1032
1026
.. _`documentation` : https://phpunit.readthedocs.io/
1033
- .. _`PHPUnit Bridge component` : https://symfony.com/components/PHPUnit%20Bridge
1034
1027
.. _`Writing Tests for PHPUnit` : https://phpunit.readthedocs.io/en/stable/writing-tests-for-phpunit.html
1035
1028
.. _`unit test` : https://en.wikipedia.org/wiki/Unit_testing
1036
1029
.. _`$_SERVER` : https://www.php.net/manual/en/reserved.variables.server.php
0 commit comments