100% of 160OPs |
100% of 27Lines |
92% of 12Branches |
100% of 9Paths |
Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
---|---|---|---|---|---|---|---|---|
mageekguy\atoum\report\fields\runner\tests\duration\cli::__construct() | 22 | 100% | 6 | 100% | 1 | 0% | 1 | 100% |
mageekguy\atoum\report\fields\runner\tests\duration\cli::__toString() | 72 | 100% | 12 | 100% | 5 | 100% | 2 | 100% |
mageekguy\atoum\report\fields\runner\tests\duration\cli::setPrompt() | 16 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\tests\duration\cli::getPrompt() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\tests\duration\cli::setTitleColorizer() | 16 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\tests\duration\cli::getTitleColorizer() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\tests\duration\cli::setDurationColorizer() | 16 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\report\fields\runner\tests\duration\cli::getDurationColorizer() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
# | |
---|---|
1 |
<?php |
2 |
|
3 |
namespace mageekguy\atoum\report\fields\runner\tests\duration; |
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\runner\tests\duration |
14 |
{ |
15 |
protected $prompt = null; |
16 |
protected $titleColorizer = null; |
17 |
protected $durationColorizer = null; |
18 |
|
19 |
public function __construct()100% |
20 |
{ |
21 |
parent::__construct(); |
22 |
|
23 |
$this |
24 |
->setPrompt() |
25 |
->setTitleColorizer() |
26 |
->setDurationColorizer() |
27 |
; |
28 |
} |
29 |
|
30 |
public function __toString()100% |
31 |
{ |
32 |
return $this->prompt . |
33 |
sprintf( |
34 |
$this->locale->_('%s: %s.'), |
35 |
$this->titleColorizer->colorize($this->locale->__('Total test duration', 'Total tests duration', $this->testNumber)), |
36 |
$this->durationColorizer->colorize( |
37 |
sprintf( |
38 |
$this->value === null ? $this->locale->_('unknown') : $this->locale->__('%4.2f second', '%4.2f seconds', $this->value), |
39 |
$this->value |
40 |
) |
41 |
) |
42 |
) . |
43 |
PHP_EOL |
44 |
; |
45 |
} |
46 |
|
47 |
public function setPrompt(prompt $prompt = null)100% |
48 |
{ |
49 |
$this->prompt = $prompt ?: new prompt(); |
50 |
|
51 |
return $this; |
52 |
} |
53 |
|
54 |
public function getPrompt()100% |
55 |
{ |
56 |
return $this->prompt; |
57 |
} |
58 |
|
59 |
public function setTitleColorizer(colorizer $titleColorizer = null)100% |
60 |
{ |
61 |
$this->titleColorizer = $titleColorizer ?: new colorizer(); |
62 |
|
63 |
return $this; |
64 |
} |
65 |
|
66 |
public function getTitleColorizer()100% |
67 |
{ |
68 |
return $this->titleColorizer; |
69 |
} |
70 |
|
71 |
public function setDurationColorizer(colorizer $durationColorizer = null)100% |
72 |
{ |
73 |
$this->durationColorizer = $durationColorizer ?: new colorizer(); |
74 |
|
75 |
return $this; |
76 |
} |
77 |
|
78 |
public function getDurationColorizer()100% |
79 |
{ |
80 |
return $this->durationColorizer; |
81 |
} |
82 |
} |