100% of 109OPs |
100% of 19Lines |
90% of 10Branches |
100% of 7Paths |
Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
---|---|---|---|---|---|---|---|---|
mageekguy\atoum\report\fields\test\run\cli::__construct() | 18 | 100% | 5 | 100% | 1 | 0% | 1 | 100% |
mageekguy\atoum\report\fields\test\run\cli::__toString() | 47 | 100% | 8 | 100% | 5 | 100% | 2 | 100% |
mageekguy\atoum\report\fields\test\run\cli::setPrompt() | 16 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\test\run\cli::getPrompt() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\test\run\cli::setColorizer() | 16 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\test\run\cli::getColorizer() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
# | |
---|---|
1 |
<?php |
2 |
|
3 |
namespace mageekguy\atoum\report\fields\test\run; |
4 |
|
5 |
use |
6 |
mageekguy\atoum, |
7 |
mageekguy\atoum\locale, |
8 |
mageekguy\atoum\cli\prompt, |
9 |
mageekguy\atoum\cli\colorizer, |
10 |
mageekguy\atoum\report |
11 |
; |
12 |
|
13 |
class cli extends report\fields\test\run |
14 |
{ |
15 |
protected $prompt = null; |
16 |
protected $colorizer = null; |
17 |
|
18 |
public function __construct()100% |
19 |
{ |
20 |
parent::__construct(); |
21 |
|
22 |
$this |
23 |
->setPrompt() |
24 |
->setColorizer() |
25 |
; |
26 |
} |
27 |
|
28 |
public function __toString()100% |
29 |
{ |
30 |
return $this->prompt . |
31 |
( |
32 |
$this->testClass === null |
33 |
? |
34 |
$this->colorizer->colorize($this->locale->_('There is currently no test running.')) |
35 |
: |
36 |
sprintf($this->locale->_('%s...'), $this->colorizer->colorize($this->testClass)) |
37 |
) . |
38 |
PHP_EOL |
39 |
; |
40 |
} |
41 |
|
42 |
public function setPrompt(prompt $prompt = null)100% |
43 |
{ |
44 |
$this->prompt = $prompt ?: new prompt(); |
45 |
|
46 |
return $this; |
47 |
} |
48 |
|
49 |
public function getPrompt()100% |
50 |
{ |
51 |
return $this->prompt; |
52 |
} |
53 |
|
54 |
public function setColorizer(colorizer $colorizer = null)100% |
55 |
{ |
56 |
$this->colorizer = $colorizer ?: new colorizer(); |
57 |
|
58 |
return $this; |
59 |
} |
60 |
|
61 |
public function getColorizer()100% |
62 |
{ |
63 |
return $this->colorizer; |
64 |
} |
65 |
} |