@@ -31,17 +31,16 @@ about :ref:`using multiple .env files in Symfony applications <configuration-mul
31
31
Resetting the Database Automatically Before each Test
32
32
-----------------------------------------------------
33
33
34
- Tests should be independent from each other to avoid side effects. However, if
35
- some test modifies the database (for example by adding or removing an element)
36
- it could impact the other tests. Run the following command to install a bundle
37
- that ensures that each test is run with a new and unmodified copy of the database:
34
+ Tests should be independent from each other to avoid side effects. For example,
35
+ if some test modifies the database (by adding or removing an entity) it could
36
+ change the results of other tests. Run the following command to install a bundle
37
+ that ensures that each test is run with the same unmodified database:
38
38
39
39
.. code-block :: terminal
40
40
41
41
$ composer require --dev dama/doctrine-test-bundle
42
42
43
- Now, enable it as a PHPUnit extension (PHPUnit 8 or higher) or a listener
44
- (PHPUnit 7 or lower):
43
+ Now, enable it as a PHPUnit extension or listener:
45
44
46
45
.. code-block :: xml
47
46
@@ -60,10 +59,10 @@ Now, enable it as a PHPUnit extension (PHPUnit 8 or higher) or a listener
60
59
</listeners >
61
60
</phpunit >
62
61
63
- This bundle uses a clever trick to create a new database for each test without
64
- scarifying performance: it begins a transaction before every test case and rolls
65
- it back automatically after the test finished . Read more in the documentation of
66
- the `DAMADoctrineTestBundle `_.
62
+ This bundle uses a clever trick to avoid side effects without scarifying
63
+ performance: it begins a database transaction before every test and rolls it
64
+ back automatically after the test finishes to undo all changes . Read more in the
65
+ documentation of the `DAMADoctrineTestBundle `_.
67
66
68
67
.. _doctrine-fixtures :
69
68
0 commit comments