mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Upgrade testsession references
This commit is contained in:
parent
ab2720f237
commit
acacac1842
@ -38,7 +38,6 @@
|
|||||||
"SilverStripe\\BehatExtension\\Tests": "tests/"
|
"SilverStripe\\BehatExtension\\Tests": "tests/"
|
||||||
},
|
},
|
||||||
"classmap": [
|
"classmap": [
|
||||||
"testsession/code",
|
|
||||||
"framework",
|
"framework",
|
||||||
"vendor/phpunit/phpunit"
|
"vendor/phpunit/phpunit"
|
||||||
]
|
]
|
||||||
|
@ -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
|
||||||
));
|
));
|
||||||
|
@ -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)
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user