File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -178,10 +178,21 @@ public function configureDatabase(bool $createSchema = true): void
178
178
179
179
// Flex includes a recipe to suffix the dbname w/ "_test" - lets keep
180
180
// things simple for these tests and not do that.
181
- $ this ->removeFromFile (
182
- 'config/packages/test/doctrine.yaml ' ,
183
- "dbname_suffix: '_test%env(default::TEST_TOKEN)%' "
184
- );
181
+ $ this ->modifyYamlFile ('config/packages/doctrine.yaml ' , function (array $ config ) {
182
+ if (isset ($ config ['when@test ' ]['doctrine ' ]['dbal ' ]['dbname_suffix ' ])) {
183
+ unset($ config ['when@test ' ]['doctrine ' ]['dbal ' ]['dbname_suffix ' ]);
184
+ }
185
+
186
+ return $ config ;
187
+ });
188
+
189
+ // @legacy DoctrineBundle 2.4 recipe uses when@test instead of a test/doctrine.yaml config
190
+ if ($ this ->filesystem ->exists ('config/packages/test/doctrine.yaml ' )) {
191
+ $ this ->removeFromFile (
192
+ 'config/packages/test/doctrine.yaml ' ,
193
+ "dbname_suffix: '_test%env(default::TEST_TOKEN)%' "
194
+ );
195
+ }
185
196
186
197
// this looks silly, but it's the only way to drop the database *for sure*,
187
198
// as doctrine:database:drop will error if there is no database
You can’t perform that action at this time.
0 commit comments