Completed
Pull Request — master (#14)
by ophelie
02:29
created

ComposeManagerPullTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 38
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testPull() 0 5 1
A testPullWithOneComposeFileSpecified() 0 6 1
A testPullpWithTwoComposeFilesSpecified() 0 6 1
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