100% of 667OPs |
100% of 110Lines |
0% of 1Branches |
100% of 1Paths |
Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
---|---|---|---|---|---|---|---|---|
mageekguy\atoum\reports\realtime\cli::__construct() | 667 | 100% | 110 | 100% | 1 | 0% | 1 | 100% |
# | |
---|---|
1 |
<?php |
2 |
|
3 |
namespace mageekguy\atoum\reports\realtime; |
4 |
|
5 |
use |
6 |
mageekguy\atoum, |
7 |
mageekguy\atoum\cli\prompt, |
8 |
mageekguy\atoum\cli\colorizer, |
9 |
mageekguy\atoum\reports\realtime, |
10 |
mageekguy\atoum\report\fields\test, |
11 |
mageekguy\atoum\report\fields\runner |
12 |
; |
13 |
|
14 |
class cli extends realtime |
15 |
{ |
16 |
public function __construct()100% |
17 |
{ |
18 |
parent::__construct(); |
19 |
|
20 |
$defaultColorizer = new colorizer('1;36'); |
21 |
|
22 |
$firstLevelPrompt = new prompt('> '); |
23 |
$secondLevelPrompt = new prompt('=> ', $defaultColorizer); |
24 |
$thirdLevelPrompt = new prompt('==> ', $defaultColorizer); |
25 |
|
26 |
$phpPathField = new runner\php\path\cli(); |
27 |
$phpPathField |
28 |
->setPrompt($firstLevelPrompt) |
29 |
->setTitleColorizer($defaultColorizer) |
30 |
; |
31 |
|
32 |
$this->addField($phpPathField); |
33 |
|
34 |
$phpVersionField = new runner\php\version\cli(); |
35 |
$phpVersionField |
36 |
->setTitlePrompt($firstLevelPrompt) |
37 |
->setTitleColorizer($defaultColorizer) |
38 |
->setVersionPrompt($secondLevelPrompt) |
39 |
; |
40 |
|
41 |
$this->addField($phpVersionField); |
42 |
|
43 |
$runnerTestsDurationField = new runner\tests\duration\cli(); |
44 |
$runnerTestsDurationField |
45 |
->setPrompt($firstLevelPrompt) |
46 |
->setTitleColorizer($defaultColorizer) |
47 |
; |
48 |
|
49 |
$this->addField($runnerTestsDurationField); |
50 |
|
51 |
$runnerTestsMemoryField = new runner\tests\memory\cli(); |
52 |
$runnerTestsMemoryField |
53 |
->setPrompt($firstLevelPrompt) |
54 |
->setTitleColorizer($defaultColorizer) |
55 |
; |
56 |
|
57 |
$this->addField($runnerTestsMemoryField); |
58 |
|
59 |
$runnerTestsCoverageField = new runner\tests\coverage\cli(); |
60 |
$runnerTestsCoverageField |
61 |
->setTitlePrompt($firstLevelPrompt) |
62 |
->setTitleColorizer($defaultColorizer) |
63 |
->setClassPrompt($secondLevelPrompt) |
64 |
->setMethodPrompt(new prompt('==> ', $defaultColorizer)) |
65 |
; |
66 |
|
67 |
$this->addField($runnerTestsCoverageField); |
68 |
|
69 |
$runnerDurationField = new runner\duration\cli(); |
70 |
$runnerDurationField |
71 |
->setPrompt($firstLevelPrompt) |
72 |
->setTitleColorizer($defaultColorizer) |
73 |
; |
74 |
|
75 |
$this->addField($runnerDurationField); |
76 |
|
77 |
$runnerResultField = new runner\result\cli(); |
78 |
$runnerResultField |
79 |
->setSuccessColorizer(new colorizer('0;37', '42')) |
80 |
->setFailureColorizer(new colorizer('0;37', '41')) |
81 |
; |
82 |
|
83 |
$this->addField($runnerResultField); |
84 |
|
85 |
$failureColorizer = new colorizer('0;31'); |
86 |
$failurePrompt = clone $secondLevelPrompt; |
87 |
$failurePrompt->setColorizer($failureColorizer); |
88 |
|
89 |
$runnerFailuresField = new runner\failures\cli(); |
90 |
$runnerFailuresField |
91 |
->setTitlePrompt($firstLevelPrompt) |
92 |
->setTitleColorizer($failureColorizer) |
93 |
->setMethodPrompt($failurePrompt) |
94 |
; |
95 |
|
96 |
$this->addField($runnerFailuresField); |
97 |
|
98 |
$runnerOutputsField = new runner\outputs\cli(); |
99 |
$runnerOutputsField |
100 |
->setTitlePrompt($firstLevelPrompt) |
101 |
->setTitleColorizer($defaultColorizer) |
102 |
->setMethodPrompt($secondLevelPrompt) |
103 |
; |
104 |
|
105 |
$this->addField($runnerOutputsField); |
106 |
|
107 |
$errorColorizer = new colorizer('0;33'); |
108 |
$errorMethodPrompt = clone $secondLevelPrompt; |
109 |
$errorMethodPrompt->setColorizer($errorColorizer); |
110 |
$errorPrompt = clone $thirdLevelPrompt; |
111 |
$errorPrompt->setColorizer($errorColorizer); |
112 |
|
113 |
$runnerErrorsField = new runner\errors\cli(); |
114 |
$runnerErrorsField |
115 |
->setTitlePrompt($firstLevelPrompt) |
116 |
->setTitleColorizer($errorColorizer) |
117 |
->setMethodPrompt($errorMethodPrompt) |
118 |
->setErrorPrompt($errorPrompt) |
119 |
; |
120 |
|
121 |
$this->addField($runnerErrorsField); |
122 |
|
123 |
$exceptionColorizer = new colorizer('0;35'); |
124 |
$exceptionMethodPrompt = clone $secondLevelPrompt; |
125 |
$exceptionMethodPrompt->setColorizer($exceptionColorizer); |
126 |
$exceptionPrompt = clone $thirdLevelPrompt; |
127 |
$exceptionPrompt->setColorizer($exceptionColorizer); |
128 |
|
129 |
$runnerExceptionsField = new runner\exceptions\cli(); |
130 |
$runnerExceptionsField |
131 |
->setTitlePrompt($firstLevelPrompt) |
132 |
->setTitleColorizer($exceptionColorizer) |
133 |
->setMethodPrompt($exceptionMethodPrompt) |
134 |
->setExceptionPrompt($exceptionPrompt) |
135 |
; |
136 |
|
137 |
$this->addField($runnerExceptionsField); |
138 |
|
139 |
$uncompletedTestColorizer = new colorizer('0;37'); |
140 |
$uncompletedTestMethodPrompt = clone $secondLevelPrompt; |
141 |
$uncompletedTestMethodPrompt->setColorizer($uncompletedTestColorizer); |
142 |
$uncompletedTestOutputPrompt = clone $thirdLevelPrompt; |
143 |
$uncompletedTestOutputPrompt->setColorizer($uncompletedTestColorizer); |
144 |
|
145 |
$runnerUncompletedField = new runner\tests\uncompleted\cli(); |
146 |
$runnerUncompletedField |
147 |
->setTitlePrompt($firstLevelPrompt) |
148 |
->setTitleColorizer($uncompletedTestColorizer) |
149 |
->setMethodPrompt($uncompletedTestMethodPrompt) |
150 |
->setOutputPrompt($uncompletedTestOutputPrompt) |
151 |
; |
152 |
|
153 |
$this->addField($runnerUncompletedField); |
154 |
|
155 |
$voidTestColorizer = new colorizer('0;34'); |
156 |
$voidTestMethodPrompt = clone $secondLevelPrompt; |
157 |
$voidTestMethodPrompt->setColorizer($voidTestColorizer); |
158 |
|
159 |
$runnerVoidField = new runner\tests\void\cli(); |
160 |
$runnerVoidField |
161 |
->setTitlePrompt($firstLevelPrompt) |
162 |
->setTitleColorizer($voidTestColorizer) |
163 |
->setMethodPrompt($voidTestMethodPrompt) |
164 |
; |
165 |
|
166 |
$this->addField($runnerVoidField); |
167 |
|
168 |
$skippedTestColorizer = new colorizer('0;90'); |
169 |
$skippedTestMethodPrompt = clone $secondLevelPrompt; |
170 |
$skippedTestMethodPrompt->setColorizer($skippedTestColorizer); |
171 |
|
172 |
$runnerSkippedField = new runner\tests\skipped\cli(); |
173 |
$runnerSkippedField |
174 |
->setTitlePrompt($firstLevelPrompt) |
175 |
->setTitleColorizer($skippedTestColorizer) |
176 |
->setMethodPrompt($skippedTestMethodPrompt) |
177 |
; |
178 |
|
179 |
$this->addField($runnerSkippedField); |
180 |
|
181 |
$testRunField = new test\run\cli(); |
182 |
$testRunField |
183 |
->setPrompt($firstLevelPrompt) |
184 |
->setColorizer($defaultColorizer) |
185 |
; |
186 |
|
187 |
$this->addField($testRunField); |
188 |
|
189 |
$this->addField(new test\event\cli()); |
190 |
|
191 |
$testDurationField = new test\duration\cli(); |
192 |
$testDurationField |
193 |
->setPrompt($secondLevelPrompt) |
194 |
; |
195 |
|
196 |
$this->addField($testDurationField); |
197 |
|
198 |
$testMemoryField = new test\memory\cli(); |
199 |
$testMemoryField |
200 |
->SetPrompt($secondLevelPrompt) |
201 |
; |
202 |
|
203 |
$this->addField($testMemoryField); |
204 |
} |
205 |
} |