Skip to content

Commit

Permalink
Merge pull request #52 from open-sausages/pulls/4.0/upgrader-tweaks
Browse files Browse the repository at this point in the history
Upgrade code with upgrader
  • Loading branch information
flamerohr authored Jul 3, 2017
2 parents 62cd630 + 0374e93 commit 2b64499
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .upgrade.yml
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion _config/routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Name: testsessionroutes
---
SilverStripe\Control\Director:
rules:
'dev/testsession': 'TestSessionController'
dev/testsession: SilverStripe\TestSession\TestSessionController
5 changes: 3 additions & 2 deletions src/TestSessionEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
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;
Expand Down Expand Up @@ -433,8 +434,8 @@ public function loadFixtureIntoDb($fixtureFile)
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();
Expand Down

0 comments on commit 2b64499

Please sign in to comment.