| @@ 54-65 (lines=12) @@ | ||
| 51 | $this->assertRegexp('/Barbaz[ ]+Lead developer[ ]/', $output); |
|
| 52 | } |
|
| 53 | ||
| 54 | public function testIllegalAction() |
|
| 55 | { |
|
| 56 | $this->shellHandler |
|
| 57 | ->expects($this->once()) |
|
| 58 | ->method('getOriginalCommand') |
|
| 59 | ->will($this->returnValue('git-bla-pack \'foobar.git\'')); |
|
| 60 | ||
| 61 | list($statusCode ,$output) = $this->runCommand($this->client, 'fabrica:git --stderr=no alice'); |
|
| 62 | ||
| 63 | $this->assertContains('Action seems illegal', $output); |
|
| 64 | } |
|
| 65 | ||
| 66 | public function testPullNonAuthorizedProject() |
|
| 67 | { |
|
| 68 | $this->shellHandler |
|
| @@ 82-96 (lines=15) @@ | ||
| 79 | $this->assertContains('You are not allowed', $output); |
|
| 80 | } |
|
| 81 | ||
| 82 | public function testPullAuthorizedProject() |
|
| 83 | { |
|
| 84 | $this->shellHandler |
|
| 85 | ->expects($this->once()) |
|
| 86 | ->method('getOriginalCommand') |
|
| 87 | ->will($this->returnValue('git-upload-pack \'foobar.git\'')); |
|
| 88 | ||
| 89 | $this->shellHandler |
|
| 90 | ->expects($this->once()) |
|
| 91 | ->method('handle'); |
|
| 92 | ||
| 93 | list($statusCode ,$output) = $this->runCommand($this->client, 'fabrica:git --stderr=no bob'); |
|
| 94 | } |
|
| 95 | ||
| 96 | public function testPushNonAuthorizedProject() |
|
| 97 | { |
|
| 98 | $this->shellHandler |
|
| 99 | ->expects($this->once()) |
|
| @@ 112-126 (lines=15) @@ | ||
| 109 | $this->assertContains('You are not allowed', $output); |
|
| 110 | } |
|
| 111 | ||
| 112 | public function testPushAuthorizedProject() |
|
| 113 | { |
|
| 114 | $this->shellHandler |
|
| 115 | ->expects($this->once()) |
|
| 116 | ->method('getOriginalCommand') |
|
| 117 | ->will($this->returnValue('git-receive-pack \'foobar.git\'')); |
|
| 118 | ||
| 119 | $this->shellHandler |
|
| 120 | ->expects($this->once()) |
|
| 121 | ->method('handle'); |
|
| 122 | ||
| 123 | list($statusCode ,$output) = $this->runCommand($this->client, 'fabrica:git --stderr=no bob'); |
|
| 124 | } |
|
| 125 | } |
|
| 126 | ||