From 0374e935e72fc8b378ceaf7ffb3b3678b0bc2ba0 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Mon, 3 Jul 2017 15:09:05 +1200 Subject: [PATCH] Upgrade code with upgrader --- .upgrade.yml | 5 +++-- _config/routes.yml | 2 +- src/TestSessionEnvironment.php | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.upgrade.yml b/.upgrade.yml index 91af6bd..22b6e52 100644 --- a/.upgrade.yml +++ b/.upgrade.yml @@ -1,6 +1,7 @@ mappings: TestSessionController: SilverStripe\TestSession\TestSessionController TestSessionEnvironment: SilverStripe\TestSession\TestSessionEnvironment - TestSessionRequestFilter: SilverStripe\TestSession\TestSessionRequestFilter + TestSessionRequestFilter: SilverStripe\TestSession\TestSessionHTTPMiddleware TestSessionStubCodeWriter: SilverStripe\TestSession\TestSessionStubCodeWriter - TestSessionStubCodeWriterTest: SilverStripe\TestSession\Tests\TestSessionStubCodeWriterTest +excludedPaths: + - '*/testsession/_config/services.yml' diff --git a/_config/routes.yml b/_config/routes.yml index 95d369e..a5b80c2 100644 --- a/_config/routes.yml +++ b/_config/routes.yml @@ -3,4 +3,4 @@ Name: testsessionroutes --- SilverStripe\Control\Director: rules: - 'dev/testsession': 'TestSessionController' + dev/testsession: SilverStripe\TestSession\TestSessionController diff --git a/src/TestSessionEnvironment.php b/src/TestSessionEnvironment.php index 39b3324..42a2e34 100644 --- a/src/TestSessionEnvironment.php +++ b/src/TestSessionEnvironment.php @@ -12,6 +12,7 @@ use SilverStripe\Core\Extensible; use SilverStripe\Core\Injector\Injectable; use SilverStripe\Core\Injector\Injector; use SilverStripe\Dev\FixtureFactory; +use SilverStripe\Dev\YamlFixture; use SilverStripe\ORM\Connect\TempDatabase; use SilverStripe\ORM\DatabaseAdmin; use SilverStripe\ORM\DB; @@ -433,8 +434,8 @@ class TestSessionEnvironment throw new LogicException("Fixture file must be inside the tests subfolder of one of your modules."); } - $factory = Injector::inst()->create('SilverStripe\\Dev\\FixtureFactory'); - $fixture = Injector::inst()->create('SilverStripe\\Dev\\YamlFixture', $fixtureFile); + $factory = Injector::inst()->create(FixtureFactory::class); + $fixture = Injector::inst()->create(YamlFixture::class, $fixtureFile); $fixture->writeInto($factory); $state = $this->getState();