| @@ 91-106 (lines=16) @@ | ||
| 88 | * |
|
| 89 | * @return string |
|
| 90 | */ |
|
| 91 | public function getTestCaseTitle(): string |
|
| 92 | { |
|
| 93 | foreach ($this->testCaseTests as $test) { |
|
| 94 | if ($test->type === TestResult::FAIL) { |
|
| 95 | return 'FAIL'; |
|
| 96 | } |
|
| 97 | } |
|
| 98 | ||
| 99 | foreach ($this->testCaseTests as $test) { |
|
| 100 | if ($test->type !== TestResult::PASS) { |
|
| 101 | return 'WARN'; |
|
| 102 | } |
|
| 103 | } |
|
| 104 | ||
| 105 | return 'PASS'; |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * Gets the test case title color. |
|
| @@ 113-128 (lines=16) @@ | ||
| 110 | * |
|
| 111 | * @return string |
|
| 112 | */ |
|
| 113 | public function getTestCaseTitleColor(): string |
|
| 114 | { |
|
| 115 | foreach ($this->testCaseTests as $test) { |
|
| 116 | if ($test->type === TestResult::FAIL) { |
|
| 117 | return 'red'; |
|
| 118 | } |
|
| 119 | } |
|
| 120 | ||
| 121 | foreach ($this->testCaseTests as $test) { |
|
| 122 | if ($test->type !== TestResult::PASS) { |
|
| 123 | return 'yellow'; |
|
| 124 | } |
|
| 125 | } |
|
| 126 | ||
| 127 | return 'green'; |
|
| 128 | } |
|
| 129 | ||
| 130 | /** |
|
| 131 | * Returns the number of tests on the current test case. |
|