47
47
* modules:
48
48
* enabled:
49
49
* - Symfony # 'ZF2' or 'Symfony'
50
- * - Doctrine2 :
50
+ * - Doctrine :
51
51
* depends: Symfony # Tells Doctrine to fetch the Entity Manager through Symfony
52
52
* cleanup: true # All doctrine queries will be wrapped in a transaction, which will be rolled back at the end of each test
53
53
* ```
57
57
* ```yaml
58
58
* modules:
59
59
* enabled:
60
- * - Doctrine2 :
60
+ * - Doctrine :
61
61
* connection_callback: ['MyDb', 'createEntityManager'] # Call the static method `MyDb::createEntityManager()` to get the Entity Manager
62
62
* ```
63
63
*
64
64
* By default, the module will wrap everything into a transaction for each test and roll it back afterwards
65
65
* (this is controlled by the `cleanup` setting).
66
66
* By doing this, tests will run much faster and will be isolated from each other.
67
67
*
68
- * To use the Doctrine2 Module in acceptance tests, set up your `acceptance.suite.yml` like this:
68
+ * To use the Doctrine Module in acceptance tests, set up your `acceptance.suite.yml` like this:
69
69
*
70
70
* ```yaml
71
71
* modules:
72
72
* enabled:
73
73
* - Symfony:
74
74
* part: SERVICES
75
- * - Doctrine2 :
75
+ * - Doctrine :
76
76
* depends: Symfony
77
77
* ```
78
78
*
84
84
* ```yaml
85
85
* modules:
86
86
* enabled:
87
- * - Doctrine2 :
87
+ * - Doctrine :
88
88
* purge_mode: 1 # 1: DELETE (=default), 2: TRUNCATE
89
89
* ```
90
90
*
146
146
*
147
147
* Note that key is ignored, because actual field name is part of criteria and/or expression.
148
148
*/
149
- class Doctrine2 extends CodeceptionModule implements DependsOnModule, DataMapper
149
+ class Doctrine extends CodeceptionModule implements DependsOnModule, DataMapper
150
150
{
151
151
private ?DoctrineProvider $ dependentModule = null ;
152
152
@@ -165,14 +165,14 @@ class Doctrine2 extends CodeceptionModule implements DependsOnModule, DataMapper
165
165
166
166
modules:
167
167
enabled:
168
- - Doctrine2 :
168
+ - Doctrine :
169
169
connection_callback: [My\ConnectionClass, getEntityManager]
170
170
171
171
Or set a dependent module, which can be either Symfony or ZF2 to get EM from service locator:
172
172
173
173
modules:
174
174
enabled:
175
- - Doctrine2 :
175
+ - Doctrine :
176
176
depends: Symfony
177
177
EOF ;
178
178
@@ -503,7 +503,7 @@ public function haveInRepository($classNameOrInstance, array $data = [])
503
503
} elseif (is_string ($ classNameOrInstance )) {
504
504
$ instance = $ this ->instantiateAndPopulateEntity ($ classNameOrInstance , $ data , $ instances );
505
505
} else {
506
- throw new InvalidArgumentException (sprintf ('Doctrine2 ::haveInRepository expects a class name or instance as first argument, got "%s" instead ' , gettype ($ classNameOrInstance )));
506
+ throw new InvalidArgumentException (sprintf ('Doctrine ::haveInRepository expects a class name or instance as first argument, got "%s" instead ' , gettype ($ classNameOrInstance )));
507
507
}
508
508
509
509
// Flush all changes to database and then refresh all entities. We need this because
0 commit comments