Skip to content

Commit

Permalink
Merge pull request #51 from silverstripe/pulls/1/env-in-shined
Browse files Browse the repository at this point in the history
Fix converted to getenv()
  • Loading branch information
Damian Mooyman authored Jun 27, 2017
2 parents 787ba1c + a5d1545 commit 81130c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TestSessionEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function applyState($state)
$state->database = $dbName; // In case it's changed by the call to SapphireTest::create_temp_db();

// Set existing one, assumes it already has been created
$prefix = defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : 'ss_';
$prefix = getenv('SS_DATABASE_PREFIX') ?: 'ss_';
$pattern = strtolower(sprintf('#^%stmpdb.*#', preg_quote($prefix, '#')));
if (!preg_match($pattern, $dbName)) {
throw new InvalidArgumentException("Invalid database name format");
Expand Down

0 comments on commit 81130c7

Please sign in to comment.