|
|
@@ -148,10 +148,11 @@ class ShellDispatcherTest extends TestCase {
|
|
|
$dispatcher = $this->getMock('Cake\Console\ShellDispatcher', ['findShell']);
|
|
|
$Shell = $this->getMock('Cake\Console\Shell');
|
|
|
|
|
|
- $Shell->expects($this->once())->method('initialize');
|
|
|
- $Shell->expects($this->once())->method('runCommand')
|
|
|
- ->with([])
|
|
|
+ $Shell->expects($this->exactly(2))->method('initialize');
|
|
|
+ $Shell->expects($this->at(0))->method('runCommand')
|
|
|
->will($this->returnValue(true));
|
|
|
+ $Shell->expects($this->at(1))->method('runCommand')
|
|
|
+ ->will($this->returnValue(null));
|
|
|
|
|
|
$dispatcher->expects($this->any())
|
|
|
->method('findShell')
|
|
|
@@ -160,7 +161,12 @@ class ShellDispatcherTest extends TestCase {
|
|
|
|
|
|
$dispatcher->args = array('mock_with_main');
|
|
|
$result = $dispatcher->dispatch();
|
|
|
- $this->assertEquals(0, $result);
|
|
|
+ $this->assertSame(0, $result);
|
|
|
+ $this->assertEquals(array(), $dispatcher->args);
|
|
|
+
|
|
|
+ $dispatcher->args = array('mock_with_main');
|
|
|
+ $result = $dispatcher->dispatch();
|
|
|
+ $this->assertSame(0, $result);
|
|
|
$this->assertEquals(array(), $dispatcher->args);
|
|
|
}
|
|
|
|
|
|
@@ -212,7 +218,7 @@ class ShellDispatcherTest extends TestCase {
|
|
|
|
|
|
$dispatcher->args = array('example');
|
|
|
$result = $dispatcher->dispatch();
|
|
|
- $this->assertEquals(1, $result);
|
|
|
+ $this->assertEquals(0, $result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -239,7 +245,7 @@ class ShellDispatcherTest extends TestCase {
|
|
|
|
|
|
$dispatcher->args = ['Example'];
|
|
|
$result = $dispatcher->dispatch();
|
|
|
- $this->assertEquals(1, $result);
|
|
|
+ $this->assertEquals(0, $result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -266,7 +272,7 @@ class ShellDispatcherTest extends TestCase {
|
|
|
|
|
|
$dispatcher->args = array('sample');
|
|
|
$result = $dispatcher->dispatch();
|
|
|
- $this->assertEquals(1, $result);
|
|
|
+ $this->assertEquals(0, $result);
|
|
|
}
|
|
|
|
|
|
/**
|