Conditions | 4 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
29 | public function render(ResultCollection $resultCollection) |
||
30 | { |
||
31 | $table = new Table(); |
||
32 | $table |
||
33 | ->setHeaderRow(['Global Status', 'Status Code', 'Name', 'Response Time']); |
||
34 | |||
35 | foreach ($resultCollection as $result) { |
||
36 | $color = $result->getExpectedStatus() != $result->getStatusCode() ? 'red' : 'green'; |
||
37 | $table->addRow([ |
||
38 | $result->getExpectedStatus() != $result->getStatusCode() ? 'FAIL' : 'OK', |
||
39 | sprintf( |
||
40 | '<bg=%s>%s</>', |
||
41 | $color, |
||
42 | $result->getStatusCode() |
||
43 | ), |
||
44 | $result->getName(), |
||
45 | $result->getReponseTime(), |
||
46 | ]); |
||
47 | } |
||
48 | |||
49 | $table->render($this->io); |
||
50 | } |
||
51 | } |
||
52 |