Skip to content

Commit fd70aad

Browse files
committed
minor #1068 [ci] handle symfony 4.4. recipe change for doctrine dsn (jrushlow)
This PR was merged into the 1.0-dev branch. Discussion ---------- [ci] handle symfony 4.4. recipe change for doctrine dsn Commits ------- 13b74a5 [ci] handle symfony 4.4. recipe change for doctrine dsn
2 parents 4023799 + 13b74a5 commit fd70aad

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/Test/MakerTestRunner.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,20 @@ public function removeFromFile(string $filename, string $find, bool $allowNotFou
170170

171171
public function configureDatabase(bool $createSchema = true): void
172172
{
173-
$this->replaceInFile(
174-
'.env',
175-
'postgresql://symfony:ChangeMe@127.0.0.1:5432/app?serverVersion=13&charset=utf8',
176-
getenv('TEST_DATABASE_DSN')
177-
);
173+
// @legacy Drop conditional when Symfony 4.4 is no longer supported.
174+
if (50000 > $this->environment->getSymfonyVersionInApp()) {
175+
$this->replaceInFile(
176+
'.env',
177+
'postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8',
178+
getenv('TEST_DATABASE_DSN')
179+
);
180+
} else {
181+
$this->replaceInFile(
182+
'.env',
183+
'postgresql://symfony:ChangeMe@127.0.0.1:5432/app?serverVersion=13&charset=utf8',
184+
getenv('TEST_DATABASE_DSN')
185+
);
186+
}
178187

179188
// Flex includes a recipe to suffix the dbname w/ "_test" - lets keep
180189
// things simple for these tests and not do that.

0 commit comments

Comments
 (0)