mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
API Upgrade to use new AssetStore service name
This commit is contained in:
parent
4f3d3fdbab
commit
1993e5d305
@ -22,7 +22,7 @@ matrix:
|
||||
before_script:
|
||||
- composer validate
|
||||
- composer install --dev --prefer-dist
|
||||
- composer require silverstripe/config:1.0.x-dev silverstripe/framework:4.0.x-dev --prefer-dist
|
||||
- composer require --update-with-dependencies silverstripe/framework:4.0.x-dev silverstripe/siteconfig:4.0.x-dev silverstripe/config:1.0.x-dev silverstripe/assets:1.0.x-dev silverstripe/versioned:1.0.x-dev --prefer-dist
|
||||
- if [[ $PHPCS_TEST ]]; then pyrus install pear/PHP_CodeSniffer; fi
|
||||
- phpenv rehash
|
||||
|
||||
|
@ -302,7 +302,9 @@ of the `TestSessionEnvironment`, in order to share it with Behat CLI.
|
||||
|
||||
Example: Retrieve the currently logged-in member
|
||||
|
||||
$env = Injector::inst()->get('TestSessionEnvironment');
|
||||
use SilverStripe\TestSession\TestsessionEnvironment;
|
||||
|
||||
$env = Injector::inst()->get(TestSessionEnvironment::class);
|
||||
$state = $env->getState();
|
||||
if(isset($state->session['loggedInAs'])) {
|
||||
$member = \Member::get()->byID($state->session['loggedInAs']);
|
||||
|
@ -28,7 +28,7 @@
|
||||
"behat/mink-extension": "^2.1",
|
||||
"behat/mink-selenium2-driver": "^1.3",
|
||||
"symfony/dom-crawler": "^3",
|
||||
"silverstripe/testsession": "2.0.0-alpha6",
|
||||
"silverstripe/testsession": "~2.0.0@alpha",
|
||||
"silverstripe/framework": "^4@dev",
|
||||
"symfony/finder": "^3.2"
|
||||
},
|
||||
|
@ -114,6 +114,7 @@ Open the already generated `FeatureContext.php` file and add the following code.
|
||||
|
||||
```php
|
||||
// mysite/tests/behat/features/bootstrap/Context/FeatureContext.php
|
||||
use namespace SilverStripe\TestSession\TestSessionStubCodeWriter;
|
||||
class FeatureContext extends SilverStripeContext {
|
||||
|
||||
protected $stubCodeWriter;
|
||||
@ -121,7 +122,7 @@ class FeatureContext extends SilverStripeContext {
|
||||
public function __construct() {
|
||||
// ...
|
||||
|
||||
$this->stubCodeWriter = Injector::inst()->get('TestSessionStubCodeWriter');
|
||||
$this->stubCodeWriter = Injector::inst()->get(TestSessionStubCodeWriter::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -761,12 +761,11 @@ class FixtureContext implements Context
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return AssetStore
|
||||
*/
|
||||
protected function getAssetStore()
|
||||
{
|
||||
return singleton('AssetStore');
|
||||
return Injector::inst()->get(AssetStore::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user