Merge pull request #157 from open-sausages/pulls/fix-fqn-services

API Upgrade to use new AssetStore service name
This commit is contained in:
Chris Joe 2017-05-16 15:20:48 +12:00 committed by GitHub
commit 18e6b9297e
5 changed files with 14 additions and 12 deletions

View File

@ -22,7 +22,7 @@ matrix:
before_script: before_script:
- composer validate - composer validate
- composer install --dev --prefer-dist - 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 - if [[ $PHPCS_TEST ]]; then pyrus install pear/PHP_CodeSniffer; fi
- phpenv rehash - 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 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(); $state = $env->getState();
if(isset($state->session['loggedInAs'])) { if(isset($state->session['loggedInAs'])) {
$member = \Member::get()->byID($state->session['loggedInAs']); $member = \Member::get()->byID($state->session['loggedInAs']);

View File

@ -28,7 +28,7 @@
"behat/mink-extension": "^2.1", "behat/mink-extension": "^2.1",
"behat/mink-selenium2-driver": "^1.3", "behat/mink-selenium2-driver": "^1.3",
"symfony/dom-crawler": "^3", "symfony/dom-crawler": "^3",
"silverstripe/testsession": "2.0.0-alpha6", "silverstripe/testsession": "~2.0.0@alpha",
"silverstripe/framework": "^4@dev", "silverstripe/framework": "^4@dev",
"symfony/finder": "^3.2" "symfony/finder": "^3.2"
}, },

View File

@ -114,6 +114,7 @@ Open the already generated `FeatureContext.php` file and add the following code.
```php ```php
// mysite/tests/behat/features/bootstrap/Context/FeatureContext.php // mysite/tests/behat/features/bootstrap/Context/FeatureContext.php
use namespace SilverStripe\TestSession\TestSessionStubCodeWriter;
class FeatureContext extends SilverStripeContext { class FeatureContext extends SilverStripeContext {
protected $stubCodeWriter; protected $stubCodeWriter;
@ -121,7 +122,7 @@ class FeatureContext extends SilverStripeContext {
public function __construct() { 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 * @return AssetStore
*/ */
protected function getAssetStore() protected function getAssetStore()
{ {
return singleton('AssetStore'); return Injector::inst()->get(AssetStore::class);
} }
/** /**