Upgrade testsession references

This commit is contained in:
Damian Mooyman 2017-04-26 16:24:20 +12:00 committed by Sam Minnée
parent ab2720f237
commit acacac1842
4 changed files with 7 additions and 5 deletions

View File

@ -38,7 +38,6 @@
"SilverStripe\\BehatExtension\\Tests": "tests/"
},
"classmap": [
"testsession/code",
"framework",
"vendor/phpunit/phpunit"
]

View File

@ -7,6 +7,7 @@ use Behat\Behat\Context\ContextInterface;
use SilverStripe\BehatExtension\Context\SilverStripeAwareContextInterface;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\TestSession\TestSessionEnvironment;
/*
* This file is part of the Behat/SilverStripeExtension
@ -74,7 +75,7 @@ class SilverStripeAwareInitializer implements InitializerInterface
file_put_contents('php://stdout', "Creating test session environment" . PHP_EOL);
$testEnv = Injector::inst()->get('TestSessionEnvironment');
$testEnv = TestSessionEnvironment::singleton();
$testEnv->startTestSession(array(
'createDatabase' => true
));

View File

@ -12,6 +12,8 @@ use Behat\Mink\Exception\ElementNotFoundException;
use InvalidArgumentException;
use SilverStripe\BehatExtension\Context\SilverStripeAwareContextInterface;
use Symfony\Component\Yaml\Yaml;
use SilverStripe\TestSession\TestSessionEnvironment;
// Mink etc.
require_once 'vendor/autoload.php';
@ -72,7 +74,7 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
{
// Initialize your context here
$this->context = $parameters;
$this->testSessionEnvironment = new \TestSessionEnvironment();
$this->testSessionEnvironment = new TestSessionEnvironment();
}
public function setDatabase($databaseName)

View File

@ -4,7 +4,7 @@ namespace SilverStripe\BehatExtension\Utility;
use SilverStripe\Dev\TestMailer as BaseTestMailer;
use SilverStripe\Core\Injector\Injector;
use TestSessionEnvironment;
use SilverStripe\TestSession\TestSessionEnvironment;
/**
* Same principle as core TestMailer class,
@ -21,7 +21,7 @@ class TestMailer extends BaseTestMailer
public function __construct()
{
$this->testSessionEnvironment = Injector::inst()->get('TestSessionEnvironment');
$this->testSessionEnvironment = TestSessionEnvironment::singleton();
}
/**