Completed
Pull Request — master (#912)
by
unknown
07:49
created

ExecTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A commandOnly() 0 6 1
A fullParameters() 0 7 1
A exception() 0 4 1
1
<?php
2
3
namespace N98\Util;
4
5
use Exception;
6
use RuntimeException;
7
8
/**
9
 * Class ExecTest
10
 *
11
 * @package N98\Util
12
 */
13
class ExecTest extends \PHPUnit_Framework_TestCase
14
{
15
    /**
16
     * @test
17
     */
18
    public function commandOnly()
19
    {
20
        Exec::run('echo test');
21
22
        $this->addToAssertionCount(1);
23
    }
24
25
    /**
26
     * @test
27
     */
28
    public function fullParameters()
29
    {
30
        Exec::run('echo test', $commandOutput, $returnCode);
31
32
        $this->assertEquals(Exec::CODE_CLEAN_EXIT, $returnCode);
33
        $this->assertStringStartsWith('test', $commandOutput);
34
    }
35
36
    /**
37
     * @test
38
     *
39
     * @expectedException RuntimeException
40
     */
41
    public function exception()
42
    {
43
        Exec::run('foobar');
44
    }
45
}
46