|
@@ 23-32 (lines=10) @@
|
| 20 |
|
test::double('Robo\Task\Base\Exec', ['output' => new \Symfony\Component\Console\Output\NullOutput()]); |
| 21 |
|
} |
| 22 |
|
|
| 23 |
|
public function testExec() |
| 24 |
|
{ |
| 25 |
|
$task = new \Robo\Task\Base\Exec('ls'); |
| 26 |
|
$task->setLogger(new \Psr\Log\NullLogger()); |
| 27 |
|
|
| 28 |
|
$result = $task->run(); |
| 29 |
|
$this->process->verifyInvoked('run'); |
| 30 |
|
verify($result->getMessage())->equals('Hello world'); |
| 31 |
|
verify($result->getExitCode())->equals(0); |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
public function testExecInBackground() |
| 35 |
|
{ |
|
@@ 34-43 (lines=10) @@
|
| 31 |
|
verify($result->getExitCode())->equals(0); |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
public function testExecInBackground() |
| 35 |
|
{ |
| 36 |
|
$task = new \Robo\Task\Base\Exec('ls'); |
| 37 |
|
$task->setLogger(new \Psr\Log\NullLogger()); |
| 38 |
|
|
| 39 |
|
$result = $task->background()->run(); |
| 40 |
|
$this->process->verifyInvoked('start'); |
| 41 |
|
$this->process->verifyNeverInvoked('run'); |
| 42 |
|
verify('exit code was not received', $result->getExitCode())->notEquals(100); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
public function testGetCommand() |
| 46 |
|
{ |