Skip to content

Commit e29a690

Browse files
committed
Added a note for the test-pack
1 parent 8954b6d commit e29a690

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

testing.rst

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ wraps the original PHPUnit binary to provide additional features:
2020

2121
.. code-block:: terminal
2222
23-
$ composer require --dev symfony/phpunit-bridge
23+
$ composer require --dev phpunit
2424
2525
Each test - whether it's a unit test or a functional test - is a PHP class
2626
that should live in the ``tests/`` directory of your application. If you follow
@@ -29,7 +29,7 @@ command:
2929

3030
.. code-block:: terminal
3131
32-
$ ./vendor/bin/simple-phpunit
32+
$ ./bin/phpunit
3333
3434
PHPUnit is configured by the ``phpunit.xml.dist`` file in the root of your
3535
Symfony application.
@@ -101,13 +101,13 @@ Running tests for a given file or directory is also very easy:
101101
.. code-block:: terminal
102102
103103
# run all tests of the application
104-
$ ./vendor/bin/simple-phpunit
104+
$ ./bin/phpunit
105105
106106
# run all tests in the Util/ directory
107-
$ ./vendor/bin/simple-phpunit tests/Util
107+
$ ./bin/phpunit tests/Util
108108
109109
# run tests for the Calculator class
110-
$ ./vendor/bin/simple-phpunit tests/Util/CalculatorTest.php
110+
$ ./bin/phpunit tests/Util/CalculatorTest.php
111111
112112
.. index::
113113
single: Tests; Functional tests
@@ -128,12 +128,6 @@ tests as far as PHPUnit is concerned, but they have a very specific workflow:
128128
Your First Functional Test
129129
~~~~~~~~~~~~~~~~~~~~~~~~~~
130130

131-
First, install the BrowserKit component in your project:
132-
133-
.. code-block:: terminal
134-
135-
$ composer require --dev browser-kit
136-
137131
Functional tests are simple PHP files that typically live in the ``tests/Controller``
138132
directory for your bundle. If you want to test the pages handled by your
139133
``PostController`` class, start by creating a new ``PostControllerTest.php``
@@ -260,6 +254,17 @@ document::
260254
$client->getResponse()->getContent()
261255
);
262256

257+
.. note::
258+
259+
Instead of adding each dependency individually, you can also run:
260+
261+
.. code-block:: terminal
262+
263+
$ composer require --dev test
264+
265+
If the ``PHPUnit Bridge`` wasn't installed before, the test pack will add
266+
it too.
267+
263268
.. index::
264269
single: Tests; Assertions
265270

0 commit comments

Comments
 (0)