Skip to content

Commit

Permalink
Or I finish my sente...
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Erkelens committed Feb 22, 2018
1 parent e4f53a9 commit 6ee7276
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/tasks/SeederTask.php
Expand Up @@ -205,8 +205,6 @@ public function parseFixture()
$parser = new Parser();
$fixtureContent = [];
if ($this->fixture->getFixtureString() !== null) {
$fixtureContent = $parser->parse($this->fixture->getFixtureString());
} else {
if (file_exists($this->fixture->getFixtureFile())) {
$contents = file_get_contents($this->fixture->getFixtureFile());
$fixtureContent = $parser->parse($contents);
Expand Down
11 changes: 6 additions & 5 deletions tests/unit/SeederTaskTest.php
Expand Up @@ -44,20 +44,21 @@ public function setUp()

public function testLive()
{
Dir
$file = Director::baseFolder() . '/.env';
file_put_contents($file,
str_replace('dev', 'live', file_get_contents($file)));
/** @var Kernel $kernel */
$kernel = Injector::inst()->get(Kernel::class);
$kernel->setEnvironment(Kernel::LIVE);

ob_start();

$request = new HTTPRequest('GET', '', ['type' => '']);
$request = new HTTPRequest('GET', '', ['type' => 'seed']);
$this->seeder->run($request);

$result = ob_get_contents();

ob_end_clean();

$this->assertContains('DO NOT RUN ME ON LIVE', $result);
$kernel->setEnvironment(Kernel::DEV);
}

public function testRun()
Expand Down

0 comments on commit 6ee7276

Please sign in to comment.