PHPUnitRunner::isValid()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace PHPRealCoverage\TestRunner;
4
5
class PHPUnitRunner
6
{
7
    /**
8
     * @var MultirunTestCommand
9
     */
10
    private $testCommand;
11
12
    private $args;
13
14
    public function __construct(MultirunTestCommand $testCommand, array $args)
15
    {
16
        $this->testCommand = $testCommand;
17
        $this->args = $args;
18
    }
19
20
    public function isValid()
21
    {
22
        ob_start();
23
        $result = $this->getRunResult();
24
        ob_end_clean();
25
        return $result;
26
    }
27
28
    /**
29
     * @return bool
30
     */
31
    private function getRunResult()
32
    {
33
        return $this->testCommand->run($this->args, false) === 0;
34
    }
35
}
36