|
@@ 101-107 (lines=7) @@
|
| 98 |
|
* |
| 99 |
|
* @expectedException \DockerCompose\Exception\ComposeFileNotFoundException |
| 100 |
|
*/ |
| 101 |
|
public function testStartThrowComposeFileNotFound() |
| 102 |
|
{ |
| 103 |
|
$error = 'Can\'t find a suitable configuration file in this directory or any parent. Are you in the right directory?\n'; |
| 104 |
|
$error .= 'Supported filenames: docker-compose.yml, docker-compose.yaml, fig.yml, fig.yaml'; |
| 105 |
|
$this->manager->method('execute')->with('docker-compose up -d')->willReturn(array('output' => $error, 'code' => 1)); |
| 106 |
|
$this->manager->start(); |
| 107 |
|
} |
| 108 |
|
|
| 109 |
|
/** |
| 110 |
|
* Test start with DockerHostConnexionErrorException |
|
@@ 114-120 (lines=7) @@
|
| 111 |
|
* |
| 112 |
|
* @expectedException \DockerCompose\Exception\DockerHostConnexionErrorException |
| 113 |
|
*/ |
| 114 |
|
public function testStartThrowDockerHostConnexionErrorException() |
| 115 |
|
{ |
| 116 |
|
$error = 'Couldn\'t connect to Docker daemon at http+docker://localunixsocket - is it running?\n'; |
| 117 |
|
$error .= 'If it\'s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.'; |
| 118 |
|
$this->manager->method('execute')->with('docker-compose up -d')->willReturn(array('output' => $error, 'code' => 1)); |
| 119 |
|
$this->manager->start(); |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
/** |
| 123 |
|
* Test start with DockerInstallationMissingException |
|
@@ 178-184 (lines=7) @@
|
| 175 |
|
* |
| 176 |
|
* @expectedException \DockerCompose\Exception\ComposeFileNotFoundException |
| 177 |
|
*/ |
| 178 |
|
public function testStopThrowComposeFileNotFound() |
| 179 |
|
{ |
| 180 |
|
$error = 'Can\'t find a suitable configuration file in this directory or any parent. Are you in the right directory?\n'; |
| 181 |
|
$error .= 'Supported filenames: docker-compose.yml, docker-compose.yaml, fig.yml, fig.yaml'; |
| 182 |
|
$this->manager->method('execute')->with('docker-compose stop')->willReturn(array('output' => $error, 'code' => 1)); |
| 183 |
|
$this->manager->stop(); |
| 184 |
|
} |
| 185 |
|
|
| 186 |
|
/** |
| 187 |
|
* Test stop with DockerHostConnexionErrorException |
|
@@ 191-197 (lines=7) @@
|
| 188 |
|
* |
| 189 |
|
* @expectedException \DockerCompose\Exception\DockerHostConnexionErrorException |
| 190 |
|
*/ |
| 191 |
|
public function testStopThrowDockerHostConnexionErrorException() |
| 192 |
|
{ |
| 193 |
|
$error = 'Couldn\'t connect to Docker daemon at http+docker://localunixsocket - is it running?\n'; |
| 194 |
|
$error .= 'If it\'s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.'; |
| 195 |
|
$this->manager->method('execute')->with('docker-compose stop')->willReturn(array('output' => $error, 'code' => 1)); |
| 196 |
|
$this->manager->stop(); |
| 197 |
|
} |
| 198 |
|
|
| 199 |
|
/** |
| 200 |
|
* Test stop with DockerInstallationMissingException |
|
@@ 271-277 (lines=7) @@
|
| 268 |
|
* |
| 269 |
|
* @expectedException \DockerCompose\Exception\ComposeFileNotFoundException |
| 270 |
|
*/ |
| 271 |
|
public function testRemoveThrowComposeFileNotFound() |
| 272 |
|
{ |
| 273 |
|
$error = 'Can\'t find a suitable configuration file in this directory or any parent. Are you in the right directory?\n'; |
| 274 |
|
$error .= 'Supported filenames: docker-compose.yml, docker-compose.yaml, fig.yml, fig.yaml'; |
| 275 |
|
$this->manager->method('execute')->with('docker-compose rm')->willReturn(array('output' => $error, 'code' => 1)); |
| 276 |
|
$this->manager->remove(); |
| 277 |
|
} |
| 278 |
|
|
| 279 |
|
/** |
| 280 |
|
* Test remove with DockerHostConnexionErrorException |
|
@@ 284-290 (lines=7) @@
|
| 281 |
|
* |
| 282 |
|
* @expectedException \DockerCompose\Exception\DockerHostConnexionErrorException |
| 283 |
|
*/ |
| 284 |
|
public function testRemoveThrowDockerHostConnexionErrorException() |
| 285 |
|
{ |
| 286 |
|
$error = 'Couldn\'t connect to Docker daemon at http+docker://localunixsocket - is it running?\n'; |
| 287 |
|
$error .= 'If it\'s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.'; |
| 288 |
|
$this->manager->method('execute')->with('docker-compose rm')->willReturn(array('output' => $error, 'code' => 1)); |
| 289 |
|
$this->manager->remove(); |
| 290 |
|
} |
| 291 |
|
|
| 292 |
|
/** |
| 293 |
|
* Test remove with DockerInstallationMissingException |