Completed
Push — master ( 662efc...619ed4 )
by ophelie
7s
created

testPullWithOneComposeFileSpecified()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace DockerCompose\Tests\Manager;
4
5
use PHPUnit_Framework_TestCase;
6
use DockerCompose\ComposeFile;
7
use DockerCompose\ComposeFileCollection;
8
9
10
class ComposeManagerPullTest extends PHPUnit_Framework_TestCase
11
{
12
    public function setUp()
13
    {
14
        $this->mockedManager = $this->getMockBuilder('\DockerCompose\Manager\ComposeManager')
15
            ->setMethods(['execute'])
16
            ->getMock();
17
    }
18
19
    /**
20
     *  Test stop whithout error
21
     */
22
    public function testPull()
23
    {
24
        $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));
25
        $this->assertEquals($this->mockedManager->pull(), 'ok');
26
    }
27
28
    /**
29
     * Test stop success with one compose file
30
     */
31
    public function testPullWithOneComposeFileSpecified()
32
    {
33
34
        $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));
35
        $this->assertEquals($this->mockedManager->pull('docker-compose.test.yml'), 'ok');
36
    }
37
38
    /**
39
     * Test stop success with two compose files
40
     */
41
    public function testPullpWithTwoComposeFilesSpecified()
42
    {
43
44
        $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));
45
        $this->assertEquals($this->mockedManager->pull(['docker-compose.yml', 'docker-compose.test.yml']), 'ok');
46
    }
47
}
48