| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function run() |
||
| 21 | { |
||
| 22 | $command = "docker inspect -f '{{.State.Running}}' " . $this->containerName . " 2>/dev/null "; |
||
| 23 | |||
| 24 | exec($command, $output, $returnValue); |
||
| 25 | |||
| 26 | $isRunning = ((bool)$output[0]); |
||
| 27 | |||
| 28 | if ($isRunning) { |
||
| 29 | return new Result(Result::STATUS_PASS, 'The container ' . $this->containerName . ' is running.'); |
||
| 30 | } else { |
||
| 31 | return new Result(Result::STATUS_FAIL, 'The container ' . $this->containerName . ' is not running.'); |
||
| 32 | } |
||
| 40 |