Skip to content

Commit

Permalink
Merge pull request #54 from open-sausages/pulls/2.0/i-am-getenv-us-of…
Browse files Browse the repository at this point in the history
…-your-progress

Fix update getenv call
  • Loading branch information
Damian Mooyman authored Oct 27, 2017
2 parents b34a4f9 + a523d66 commit 03a1311
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 03a1311

Please sign in to comment.