Skip to content

Commit

Permalink
Adjust tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 27, 2016
1 parent 35d6df5 commit da3dec0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/TestCase/Shell/Task/LoadTaskTest.php
Expand Up @@ -22,6 +22,10 @@
*/
class LoadTaskTest extends TestCase
{
/**
* @var \Cake\Shell\Task\LoadTask|\PHPUnit_Framework_MockObject_MockObject
*/
protected $Task;

/**
* setUp method
Expand Down Expand Up @@ -73,6 +77,7 @@ public function testLoad()
'bootstrap' => false,
'routes' => false,
'autoload' => true,
'cli' => false
];

$action = $this->Task->main('TestPlugin');
Expand All @@ -95,6 +100,7 @@ public function testLoadWithBootstrap()
'bootstrap' => true,
'routes' => false,
'autoload' => true,
'cli' => false
];

$action = $this->Task->main('TestPlugin');
Expand All @@ -117,6 +123,7 @@ public function testLoadWithRoutes()
'bootstrap' => false,
'routes' => true,
'autoload' => true,
'cli' => false
];

$action = $this->Task->main('TestPlugin');
Expand All @@ -139,6 +146,7 @@ public function testLoadNoAutoload()
'bootstrap' => false,
'routes' => true,
'autoload' => false,
'cli' => false
];

$action = $this->Task->main('TestPlugin');
Expand All @@ -161,6 +169,7 @@ public function testLoadNothing()
'bootstrap' => false,
'routes' => false,
'autoload' => false,
'cli' => false
];

$action = $this->Task->main('TestPlugin');
Expand Down
12 changes: 12 additions & 0 deletions tests/TestCase/Shell/Task/UnloadTaskTest.php
Expand Up @@ -22,6 +22,10 @@
*/
class UnloadTaskTest extends TestCase
{
/**
* @var \Cake\Shell\Task\UnloadTask|\PHPUnit_Framework_MockObject_MockObject
*/
protected $Task;

/**
* setUp method
Expand Down Expand Up @@ -80,6 +84,10 @@ public function testUnload()
$expected = "Plugin::load('TestPlugin', ['autoload' => true, 'bootstrap' => false, 'routes' => false]);";
$this->assertContains($expected, $bootstrap->read());

$this->Task->params = [
'cli' => false
];

$action = $this->Task->main('TestPlugin');

$this->assertTrue($action);
Expand All @@ -98,6 +106,10 @@ public function testRegularExpressions()
{
$bootstrap = new File($this->bootstrap, false);

$this->Task->params = [
'cli' => false
];

// Plugin::load('TestPlugin', [
// 'boostrap' => false
// ]);
Expand Down

0 comments on commit da3dec0

Please sign in to comment.