@@ -20,7 +20,7 @@ wraps the original PHPUnit binary to provide additional features:
20
20
21
21
.. code-block :: terminal
22
22
23
- $ composer require --dev symfony/ phpunit-bridge
23
+ $ composer require --dev phpunit
24
24
25
25
Each test - whether it's a unit test or a functional test - is a PHP class
26
26
that should live in the ``tests/ `` directory of your application. If you follow
@@ -29,7 +29,7 @@ command:
29
29
30
30
.. code-block :: terminal
31
31
32
- $ ./vendor/ bin/simple- phpunit
32
+ $ ./bin/phpunit
33
33
34
34
PHPUnit is configured by the ``phpunit.xml.dist `` file in the root of your
35
35
Symfony application.
@@ -101,13 +101,13 @@ Running tests for a given file or directory is also very easy:
101
101
.. code-block :: terminal
102
102
103
103
# run all tests of the application
104
- $ ./vendor/ bin/simple- phpunit
104
+ $ ./bin/phpunit
105
105
106
106
# run all tests in the Util/ directory
107
- $ ./vendor/ bin/simple- phpunit tests/Util
107
+ $ ./bin/phpunit tests/Util
108
108
109
109
# run tests for the Calculator class
110
- $ ./vendor/ bin/simple- phpunit tests/Util/CalculatorTest.php
110
+ $ ./bin/phpunit tests/Util/CalculatorTest.php
111
111
112
112
.. index ::
113
113
single: Tests; Functional tests
@@ -128,12 +128,6 @@ tests as far as PHPUnit is concerned, but they have a very specific workflow:
128
128
Your First Functional Test
129
129
~~~~~~~~~~~~~~~~~~~~~~~~~~
130
130
131
- First, install the BrowserKit component in your project:
132
-
133
- .. code-block :: terminal
134
-
135
- $ composer require --dev browser-kit
136
-
137
131
Functional tests are simple PHP files that typically live in the ``tests/Controller ``
138
132
directory for your bundle. If you want to test the pages handled by your
139
133
``PostController `` class, start by creating a new ``PostControllerTest.php ``
@@ -260,6 +254,17 @@ document::
260
254
$client->getResponse()->getContent()
261
255
);
262
256
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
+
263
268
.. index ::
264
269
single: Tests; Assertions
265
270
0 commit comments