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/" "SilverStripe\\BehatExtension\\Tests": "tests/"
}, },
"classmap": [ "classmap": [
"testsession/code",
"framework", "framework",
"vendor/phpunit/phpunit" "vendor/phpunit/phpunit"
] ]

View File

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

View File

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

View File

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