|
@@ 40-53 (lines=14) @@
|
| 37 |
|
$this->client->stopIsolation(); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
public function testShellInformation() |
| 41 |
|
{ |
| 42 |
|
$this->shellHandler |
| 43 |
|
->expects($this->once()) |
| 44 |
|
->method('getOriginalCommand') |
| 45 |
|
->will($this->returnValue(null)); |
| 46 |
|
|
| 47 |
|
list($statusCode ,$output) = $this->runCommand($this->client, 'fabrica:git --stderr=no alice'); |
| 48 |
|
|
| 49 |
|
$this->assertContains('You are identified as alice', $output); |
| 50 |
|
$this->assertRegexp('/Foobar[ ]+Developer[ ]/', $output); |
| 51 |
|
$this->assertRegexp('/Barbaz[ ]+Lead developer[ ]/', $output); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
public function testIllegalAction() |
| 55 |
|
{ |
| 56 |
|
$this->shellHandler |
|
@@ 66-82 (lines=17) @@
|
| 63 |
|
$this->assertContains('Action seems illegal', $output); |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
public function testPullNonAuthorizedProject() |
| 67 |
|
{ |
| 68 |
|
$this->shellHandler |
| 69 |
|
->expects($this->once()) |
| 70 |
|
->method('getOriginalCommand') |
| 71 |
|
->will($this->returnValue('git-upload-pack \'barbaz.git\'')); |
| 72 |
|
|
| 73 |
|
$this->shellHandler |
| 74 |
|
->expects($this->never()) |
| 75 |
|
->method('handle'); |
| 76 |
|
|
| 77 |
|
list($statusCode ,$output) = $this->runCommand($this->client, 'fabrica:git --stderr=no bob'); |
| 78 |
|
|
| 79 |
|
$this->assertContains('You are not allowed', $output); |
| 80 |
|
} |
| 81 |
|
|
| 82 |
|
public function testPullAuthorizedProject() |
| 83 |
|
{ |
| 84 |
|
$this->shellHandler |
| 85 |
|
->expects($this->once()) |
|
@@ 96-112 (lines=17) @@
|
| 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()) |
| 100 |
|
->method('getOriginalCommand') |
| 101 |
|
->will($this->returnValue('git-receive-pack \'barbaz.git\'')); |
| 102 |
|
|
| 103 |
|
$this->shellHandler |
| 104 |
|
->expects($this->never()) |
| 105 |
|
->method('handle'); |
| 106 |
|
|
| 107 |
|
list($statusCode ,$output) = $this->runCommand($this->client, 'fabrica:git --stderr=no bob'); |
| 108 |
|
|
| 109 |
|
$this->assertContains('You are not allowed', $output); |
| 110 |
|
} |
| 111 |
|
|
| 112 |
|
public function testPushAuthorizedProject() |
| 113 |
|
{ |
| 114 |
|
$this->shellHandler |
| 115 |
|
->expects($this->once()) |