Merge pull request #102 from jeffreyguo/pulls/end-testsession-once

add condition to prevent running endTestSession() twice
This commit is contained in:
Damian Mooyman 2015-12-21 14:26:34 +13:00
commit 700e53f4f6
1 changed files with 4 additions and 4 deletions

View File

@ -83,13 +83,13 @@ class SilverStripeAwareInitializer implements InitializerInterface
public function __destruct()
{
file_put_contents('php://stdout', "Killing test session environment...");
// Add condition here as register_shutdown_function() also calls this in __construct()
if($this->testSessionEnvironment) {
file_put_contents('php://stdout', "Killing test session environment...");
$this->testSessionEnvironment->endTestSession();
$this->testSessionEnvironment = null;
file_put_contents('php://stdout', " done!" . PHP_EOL);
}
file_put_contents('php://stdout', " done!" . PHP_EOL);
}
/**