Skip to content

Commit b0d51cf

Browse files
committed
Update the definition of th test names.
1 parent f7d59f7 commit b0d51cf

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

testing.rst

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,27 @@ application's tests with the same command as before.
3939

4040
PHPUnit is configured by the ``phpunit.xml.dist`` file in the root of your application.
4141

42-
.. tip::
43-
44-
Use the ``--coverage-*`` command options to generate code coverage reports.
45-
Read the PHPUnit manual to learn more about `code coverage analysis`_.
46-
4742
Types of Tests
4843
--------------
4944

45+
To get a common language and shared context, it is important to define a what different
46+
types of tests really mean. Symfony will use the following definition. If you have
47+
learned something different, that is not necessarily wrong. It is just different
48+
from what the Symfony documentation is using.
49+
5050
`Unit Tests`_
5151
These tests ensure that *individual* units of source code (e.g. a single
5252
class) behave as intended.
5353

5454
`Integration Tests`_
5555
These tests test a combination of classes and commonly interact with
5656
Symfony's service container. These tests do not yet cover the full
57-
working application, those are called *Functional tests*.
57+
working application, those are called *Application tests*.
5858

59-
`Functional Tests`_
60-
Functional tests test the behavior of a complete application. They
59+
`Application Tests`_
60+
Application tests test the behavior of a complete application. They
6161
make HTTP requests and test that the response is as expected.
6262

63-
`End to End Tests (E2E)`_
64-
At last, end to end tests test the application as a real user. They use
65-
a real browser and real integrations with external services.
66-
6763
Unit Tests
6864
----------
6965

@@ -152,10 +148,10 @@ TODO
152148

153149
.. _functional-tests:
154150

155-
Functional Tests
151+
Application Tests
156152
----------------
157153

158-
Functional tests check the integration of the different layers of an
154+
Application tests check the integration of the different layers of an
159155
application (from the routing to the views). They are no different from unit
160156
tests as far as PHPUnit is concerned, but they have a very specific workflow:
161157

@@ -175,7 +171,7 @@ tests:
175171
Set-up your Test Environment
176172
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177173

178-
The Client used by functional tests creates a Kernel that runs in a special
174+
The Client used by application tests creates a Kernel that runs in a special
179175
``test`` environment. Since Symfony loads the ``config/packages/test/*.yaml``
180176
in the ``test`` environment, you can tweak any of your application's settings
181177
specifically for testing.
@@ -363,7 +359,7 @@ For more information, read the `DoctrineFixturesBundle documentation`_.
363359
Write Your First Functional Test
364360
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
365361

366-
Functional tests are PHP files that typically live in the ``tests/Controller``
362+
Application tests are PHP files that typically live in the ``tests/Controller``
367363
directory of your application. If you want to test the pages handled by your
368364
``PostController`` class, start by creating a new ``PostControllerTest.php``
369365
file that extends a special ``WebTestCase`` class.
@@ -389,7 +385,7 @@ As an example, a test could look like this::
389385

390386
.. tip::
391387

392-
To run your functional tests, the ``WebTestCase`` class needs to know which
388+
To run your application tests, the ``WebTestCase`` class needs to know which
393389
is the application kernel to bootstrap it. The kernel class is usually
394390
defined in the ``KERNEL_CLASS`` environment variable (included in the
395391
default ``.env.test`` file provided by Symfony):
@@ -482,7 +478,7 @@ returns a ``Crawler`` instance.
482478

483479
.. tip::
484480

485-
Hardcoding the request URLs is a best practice for functional tests. If the
481+
Hardcoding the request URLs is a best practice for application tests. If the
486482
test generates URLs using the Symfony router, it won't detect any change
487483
made to the application URLs which may impact the end users.
488484

@@ -698,7 +694,7 @@ You can also override HTTP headers on a per request basis::
698694
Reporting Exceptions
699695
....................
700696

701-
Debugging exceptions in functional tests may be difficult because by default
697+
Debugging exceptions in application tests may be difficult because by default
702698
they are caught and you need to look at the logs to see which exception was
703699
thrown. Disabling catching of exceptions in the test client allows the exception
704700
to be reported by PHPUnit::

0 commit comments

Comments
 (0)