Completed
Push — master ( 3e91ce...851d6f )
by Christian
02:31
created

testThatCrossPlatformProgramRuns()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace uuf6429\ElderBrother\Action;
4
5
use Symfony\Component\Console\Input;
6
use Symfony\Component\Console\Output;
7
use Symfony\Component\Process\Exception\ProcessFailedException;
8
9
class ExecuteProgramTest extends \PHPUnit_Framework_TestCase
10
{
11
    public function testThatCrossPlatformProgramRuns()
12
    {
13
        $action = new ExecuteProgram(
14
            'Run "dir"',
15
            'dir'
16
        );
17
18
        $action->execute(new Input\StringInput(''), new Output\NullOutput());
19
20
        $this->assertSame('Run "dir" (ExecuteProgram)', $action->getName());
21
    }
22
23
    public function testThatRunningFictitiousProgramCausesException()
24
    {
25
        $action = new ExecuteProgram(
26
            'Run "a-non-existent-program"',
27
            'a-non-existent-program'
28
        );
29
30
        $this->setExpectedException(ProcessFailedException::class);
31
32
        $action->execute(new Input\StringInput(''), new Output\NullOutput());
33
    }
34
}
35