PHPUnitRunner   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isValid() 0 7 1
A getRunResult() 0 4 1
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