Skip to content

Commit

Permalink
Fix update getenv call
Browse files Browse the repository at this point in the history
  • Loading branch information
flamerohr committed Oct 27, 2017
1 parent b34a4f9 commit a523d66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/TestSessionEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Exception;
use InvalidArgumentException;
use LogicException;
use SilverStripe\Core\Environment;
use SilverStripe\Control\Director;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Core\Config\Configurable;
Expand Down Expand Up @@ -250,7 +251,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 = getenv('SS_DATABASE_PREFIX') ?: 'ss_';
$prefix = Environment::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 a523d66

Please sign in to comment.