API Upgrade to use new AssetStore service name

This commit is contained in:
Damian Mooyman 2017-05-16 14:42:47 +12:00
parent 4f3d3fdbab
commit 1993e5d305
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
5 changed files with 14 additions and 12 deletions

View File

@ -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

View File

@ -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']);

View File

@ -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"
},

View File

@ -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);
}
/**

View File

@ -761,12 +761,11 @@ class FixtureContext implements Context
}
/**
*
* @return AssetStore
*/
protected function getAssetStore()
{
return singleton('AssetStore');
return Injector::inst()->get(AssetStore::class);
}
/**