| Conditions | 4 |
| Paths | 6 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function invokeTest() |
||
| 38 | { |
||
| 39 | $testResult = new TestResult('Memcache Server Group Health', 'Group ' . $this->group); |
||
| 40 | |||
| 41 | $states = array(); |
||
| 42 | foreach ($this->results as $result) { |
||
| 43 | $states[] = $result->getState(); |
||
| 44 | } |
||
| 45 | $state = min($states); |
||
| 46 | |||
| 47 | $testResult->setState($state); |
||
| 48 | |||
| 49 | if ($state === State::OK) { |
||
| 50 | $testResult->setMessage('Group is healthy'); |
||
| 51 | } elseif ($state === State::WARNING) { |
||
| 52 | $testResult->setMessage('Group is crippled'); |
||
| 53 | } else { |
||
| 54 | $testResult->setMessage('Group is down'); |
||
| 55 | } |
||
| 56 | |||
| 57 | $this->setTestResult($testResult); |
||
| 58 | } |
||
| 60 |