Skip to content

Commit 9123b20

Browse files
ThomasLandauerNaktibalda
authored andcommitted
Document that cleanup doesn't work in acceptance tests
Re-submitting Codeception/Codeception#5734 and #1 - finally closing Codeception/Codeception#5286 now (I hope :-)
1 parent db9f605 commit 9123b20

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/Codeception/Module/Doctrine2.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,23 @@
6060
*
6161
* This will use static method of `MyDb::createEntityManager()` to establish the Entity Manager.
6262
*
63-
* By default, the module will wrap everything into a transaction for each test and roll it back afterwards. By doing this
64-
* tests will run much faster and will be isolated from each other.
63+
* By default, the module will wrap everything into a transaction for each test and roll it back afterwards
64+
* (this is controlled by the `cleanup` setting).
65+
* By doing this, tests will run much faster and will be isolated from each other.
66+
*
67+
* To use the Doctrine2 Module in acceptance tests, set up your `acceptance.suite.yml` like this:
68+
*
69+
* ```yaml
70+
* modules:
71+
* enabled:
72+
* - Symfony:
73+
* part: SERVICES
74+
* - Doctrine2:
75+
* depends: Symfony
76+
* ``
77+
*
78+
* You cannot use `cleanup: true` in an acceptance test, since Codeception and your app (i.e. browser) are using two
79+
* different connections to the database, so Codeception can't wrap changes made by the app into a transaction.
6580
*
6681
* ## Status
6782
*

0 commit comments

Comments
 (0)