Skip to content

Commit 0d5d693

Browse files
clxmstaabstaabm
authored andcommitted
testsuite: introduce env-vars for db credentials
1 parent 9a1f895 commit 0d5d693

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/ReflectorFactory.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ final class ReflectorFactory
1414
public static function create(string $cacheFile): QueryReflector
1515
{
1616
if (false !== getenv('GITHUB_ACTION')) {
17-
$host = '127.0.0.1';
18-
$user = 'root';
19-
$password = 'root';
20-
$dbname = 'phpstan_dba';
17+
$host = getenv('DBA_HOST') ?: '127.0.0.1';
18+
$user = getenv('DBA_USER') ?: 'root';
19+
$password = getenv('DBA_PASSWORD') ?: 'root';
20+
$dbname = getenv('DBA_DATABASE') ?: 'phpstan_dba';
2121
} else {
22-
$host = 'mysql80.ab';
23-
$user = 'testuser';
24-
$password = 'test';
25-
$dbname = 'phpstan_dba';
22+
$host = getenv('DBA_HOST') ?: 'mysql80.ab';
23+
$user = getenv('DBA_USER') ?: 'testuser';
24+
$password = getenv('DBA_PASSWORD') ?: 'test';
25+
$dbname = getenv('DBA_DATABASE') ?: 'phpstan_dba';
2626
}
2727

2828
$mode = getenv('DBA_MODE') ?: 'recording';

0 commit comments

Comments
 (0)