| Conditions | 1 |
| Paths | 1 |
| Total Lines | 28 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function testMemcacheServerGroup(): void |
||
| 16 | { |
||
| 17 | $a = new TestResult(); |
||
| 18 | $a->setState(State::OK); |
||
| 19 | |||
| 20 | $b = new TestResult(); |
||
| 21 | $b->setState(State::ERROR); |
||
| 22 | |||
| 23 | $testData = new TestData([ |
||
| 24 | 'results' => [$a, $a], |
||
| 25 | ]); |
||
| 26 | $testCase = new TestCase\Store\Memcache\ServerGroup($testData); |
||
| 27 | $testResult = $testCase->getTestResult(); |
||
| 28 | $this->assertEquals(State::OK, $testResult->getState()); |
||
| 29 | |||
| 30 | $testData = new TestData([ |
||
| 31 | 'results' => [$a, $b], |
||
| 32 | ]); |
||
| 33 | $testCase = new TestCase\Store\Memcache\ServerGroup($testData); |
||
| 34 | $testResult = $testCase->getTestResult(); |
||
| 35 | $this->assertEquals(State::WARNING, $testResult->getState()); |
||
| 36 | |||
| 37 | $testData = new TestData([ |
||
| 38 | 'results' => [$b, $b], |
||
| 39 | ]); |
||
| 40 | $testCase = new TestCase\Store\Memcache\ServerGroup($testData); |
||
| 41 | $testResult = $testCase->getTestResult(); |
||
| 42 | $this->assertEquals(State::ERROR, $testResult->getState()); |
||
| 43 | } |
||
| 45 |