Skip to content
Permalink
Browse files

Add test for cli.

  • Loading branch information...
dereuromark committed Nov 27, 2016
1 parent da3dec0 commit 27dc4bf7c68aa117d36ea9525c99c4e837001a07
Showing with 26 additions and 0 deletions.
  1. +26 −0 tests/TestCase/Shell/Task/LoadTaskTest.php
@@ -46,6 +46,8 @@ public function setUp()
->getMock();
$this->bootstrap = ROOT . DS . 'config' . DS . 'bootstrap.php';
$this->bootstrapCli = ROOT . DS . 'config' . DS . 'bootstrap_cli.php';
copy($this->bootstrap, $this->bootstrapCli);
$bootstrap = new File($this->bootstrap, false);
$this->originalBootstrapContent = $bootstrap->read();
@@ -64,6 +66,7 @@ public function tearDown()
$bootstrap = new File($this->bootstrap, false);
$bootstrap->write($this->originalBootstrapContent);
unlink($this->bootstrapCli);
}
/**
@@ -112,6 +115,29 @@ public function testLoadWithBootstrap()
$this->assertContains($expected, $bootstrap->read());
}
/**
* Tests that loading with bootstrap_cli works.
*
* @return void
*/
public function testLoadBootstrapCli()
{
$this->Task->params = [
'bootstrap' => false,
'routes' => false,
'autoload' => false,
'cli' => true
];
$action = $this->Task->main('CliPlugin');
$this->assertTrue($action);
$expected = "Plugin::load('CliPlugin');";
$bootstrap = new File($this->bootstrapCli, false);
$this->assertContains($expected, $bootstrap->read());
}
/**
* testLoadWithRoutes
*

0 comments on commit 27dc4bf

Please sign in to comment.
You can’t perform that action at this time.