StepPushTest::testGetCommand()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 18

Duplication

Lines 24
Ratio 100 %

Importance

Changes 4
Bugs 0 Features 2
Metric Value
c 4
b 0
f 2
dl 24
loc 24
rs 8.9713
cc 1
eloc 18
nc 1
nop 0
1
<?php
2
/**
3
 * Test suite for the push step.
4
 */
5
6
namespace Graviton\Deployment\Tests\Steps\CloudFoundry;
7
8
use Graviton\Deployment\DeployScriptsTestCase;
9
use Graviton\Deployment\Steps\CloudFoundry\StepPush;
10
11
/**
12
 * @author   List of contributors <https://github.com/libgraviton/deploy-scripts/graphs/contributors>
13
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
14
 * @link     http://swisscom.ch
15
 */
16
class StepPushTest extends DeployScriptsTestCase
17
{
18
    /**
19
     * Validate getCommand
20
     *
21
     * @return void
22
     */
23 View Code Duplication
    public function testGetCommand()
24
    {
25
        $configuration = $this->getConfigurationSet();
26
        $step = new StepPush(
27
            $configuration,
28
            'my_personal_application-unstable',
29
            'blue',
30
            true,
31
            true,
32
            "php app/console doctrine:mongodb:fixtures:load unstable"
33
        );
34
35
        $this->assertEquals(
36
            array(
37
                '/usr/bin/cf',
38
                'push',
39
                'my_personal_application-unstable-blue',
40
                '--no-route',
41
                '-c',
42
                'php app/console doctrine:mongodb:fixtures:load unstable'
43
            ),
44
            $step->getCommand()
45
        );
46
    }
47
48
    /**
49
     * Validate getCommand with flag --no-start
50
     *
51
     * @return void
52
     */
53 View Code Duplication
    public function testGetCommandStartFalse()
54
    {
55
        $configuration = $this->getConfigurationSet();
56
        $step = new StepPush(
57
            $configuration,
58
            'my_personal_application-unstable',
59
            'blue',
60
            false,
61
            true,
62
            "php app/console doctrine:mongodb:fixtures:load unstable"
63
        );
64
65
        $this->assertEquals(
66
            array(
67
                '/usr/bin/cf',
68
                'push',
69
                'my_personal_application-unstable-blue',
70
                '--no-start',
71
                '--no-route',
72
                '-c',
73
                'php app/console doctrine:mongodb:fixtures:load unstable'
74
            ),
75
            $step->getCommand()
76
        );
77
    }
78
}
79