@@ 32-52 (lines=21) @@ | ||
29 | $this->git->verifyInvoked('executeCommand', ['git add -A && git pull']); |
|
30 | } |
|
31 | ||
32 | public function testGitStackCommands() |
|
33 | { |
|
34 | $linuxCmd = "git clone http://github.com/consolidation-org/Robo && git pull && git add -A && git commit -m 'changed' && git push && git tag 0.6.0 && git push origin 0.6.0"; |
|
35 | ||
36 | $winCmd = 'git clone http://github.com/consolidation-org/Robo && git pull && git add -A && git commit -m "changed" && git push && git tag 0.6.0 && git push origin 0.6.0'; |
|
37 | ||
38 | $cmd = stripos(PHP_OS, 'WIN') === 0 ? $winCmd : $linuxCmd; |
|
39 | ||
40 | $this->assertEquals( |
|
41 | $cmd, |
|
42 | (new \Robo\Task\Vcs\GitStack()) |
|
43 | ->cloneRepo('http://github.com/consolidation-org/Robo') |
|
44 | ->pull() |
|
45 | ->add('-A') |
|
46 | ->commit('changed') |
|
47 | ->push() |
|
48 | ->tag('0.6.0') |
|
49 | ->push('origin', '0.6.0') |
|
50 | ->getCommand() |
|
51 | ); |
|
52 | } |
|
53 | ||
54 | public function testGitStackCommandsWithTagMessage() |
|
55 | { |
|
@@ 54-74 (lines=21) @@ | ||
51 | ); |
|
52 | } |
|
53 | ||
54 | public function testGitStackCommandsWithTagMessage() |
|
55 | { |
|
56 | $linuxCmd = "git clone http://github.com/consolidation-org/Robo && git pull && git add -A && git commit -m 'changed' && git push && git tag -m 'message' 0.6.0 && git push origin 0.6.0"; |
|
57 | ||
58 | $winCmd = 'git clone http://github.com/consolidation-org/Robo && git pull && git add -A && git commit -m "changed" && git push && git tag -m \'message\' 0.6.0 && git push origin 0.6.0'; |
|
59 | ||
60 | $cmd = stripos(PHP_OS, 'WIN') === 0 ? $winCmd : $linuxCmd; |
|
61 | ||
62 | $this->assertEquals( |
|
63 | $cmd, |
|
64 | (new \Robo\Task\Vcs\GitStack()) |
|
65 | ->cloneRepo('http://github.com/consolidation-org/Robo') |
|
66 | ->pull() |
|
67 | ->add('-A') |
|
68 | ->commit('changed') |
|
69 | ->push() |
|
70 | ->tag('0.6.0', 'message') |
|
71 | ->push('origin', '0.6.0') |
|
72 | ->getCommand() |
|
73 | ); |
|
74 | } |
|
75 | ||
76 | public function testGitStackShallowCloneCommand() |
|
77 | { |