Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Prevent undefined method on error

  • Loading branch information...
commit 21b05999ee5761b112b58998d65f472100ca04c2 1 parent 3d1ea1d
@wilr wilr authored
View
10 src/SilverStripe/BehatExtension/Context/Initializer/SilverStripeAwareInitializer.php
@@ -72,8 +72,8 @@ public function __construct($frameworkPath)
));
$state = $testEnv->getState();
- $this->databaseName = $state->database;
+ $this->databaseName = $state->database;
$this->testSessionEnvironment = $testEnv;
file_put_contents('php://stdout', "Temp Database: $this->databaseName" . PHP_EOL . PHP_EOL);
@@ -83,11 +83,13 @@ public function __construct($frameworkPath)
public function __destruct()
{
- file_put_contents('php://stdout', "Killing test session environment...");
+ file_put_contents('php://stdout', "Killing test session environment...");
- $this->testSessionEnvironment->endTestSession();
+ if($this->testSessionEnvironment) {
+ $this->testSessionEnvironment->endTestSession();
+ }
- file_put_contents('php://stdout', " done!" . PHP_EOL);
+ file_put_contents('php://stdout', " done!" . PHP_EOL);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.