Completed
Push — develop ( 2eea19...05bbe8 )
by
unknown
13:03
created

StashCommandTest   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 87
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 2
dl 0
loc 87
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A testSave() 0 6 1
A testList() 0 6 1
A testShow() 0 5 1
A testDrop() 0 5 1
A testApply() 0 6 1
A testPop() 0 6 1
A testBranch() 0 5 1
A testClear() 0 5 1
A testCreate() 0 5 1
1
<?php
2
/**
3
 * User: matteo
4
 * Date: 06/06/13
5
 * Time: 23.45
6
 * Just for fun...
7
 */
8
9
namespace GitElephant\Command;
10
11
use \GitElephant\TestCase;
12
13
/**
14
 * Class StashCommandTest
15
 *
16
 * @package GitElephant\Command
17
 */
18
class StashCommandTest extends TestCase
19
{
20
    /**
21
     * testSave
22
     */
23
    public function testSave()
24
    {
25
        $command = StashCommand::getInstance();
26
        $this->assertEquals("stash save 'Test'", $command->save('Test'));
27
        $this->assertEquals("stash save '--include-untracked' '--keep-index' 'Test'", $command->save('Test', true, true));
28
    }
29
30
    /**
31
     * testList
32
     */
33
    public function testList()
34
    {
35
        $command = StashCommand::getInstance();
36
        $this->assertEquals("stash list", $command->listStashes());
37
        $this->assertEquals("stash list '-p'", $command->listStashes(array('-p')));
38
    }
39
40
    /**
41
     * testShow
42
     */
43
    public function testShow()
44
    {
45
        $command = StashCommand::getInstance();
46
        $this->assertEquals("stash show 'stash@{0}'", $command->show(0));
47
    }
48
49
    /**
50
     * testDrop
51
     */
52
    public function testDrop()
53
    {
54
        $command = StashCommand::getInstance();
55
        $this->assertEquals("stash drop 'stash@{0}'", $command->drop(0));
56
    }
57
58
    /**
59
     * testApply
60
     */
61
    public function testApply()
62
    {
63
        $command = StashCommand::getInstance();
64
        $this->assertEquals("stash apply 'stash@{0}'", $command->apply(0));
65
        $this->assertEquals("stash apply '--index' 'stash@{0}'", $command->apply(0, true));
66
    }
67
68
    /**
69
     * testPop
70
     */
71
    public function testPop()
72
    {
73
        $command = StashCommand::getInstance();
74
        $this->assertEquals("stash pop 'stash@{0}'", $command->pop(0));
75
        $this->assertEquals("stash pop '--index' 'stash@{0}'", $command->pop(0, true));
76
    }
77
78
    /**
79
     * testBranch
80
     */
81
    public function testBranch()
82
    {
83
        $command = StashCommand::getInstance();
84
        $this->assertEquals("stash branch 'testbranch' 'stash@{0}'", $command->branch('testbranch', 0));
85
    }
86
87
    /**
88
     * testClear
89
     */
90
    public function testClear()
91
    {
92
        $command = StashCommand::getInstance();
93
        $this->assertEquals("stash clear", $command->clear());
94
    }
95
96
    /**
97
     * testCreate
98
     */
99
    public function testCreate()
100
    {
101
        $command = StashCommand::getInstance();
102
        $this->assertEquals("stash create", $command->create());
103
    }
104
}
105