예제 #1
0
 public function testFailedCall()
 {
     $binary = new Binary(GIT_BINARY);
     $call = $binary->createGitCall('/', 'unknowncommand', array());
     $result = $call->execute();
     $this->assertFalse($result->hasStdOut());
     $this->assertTrue($result->hasStdErr());
     $this->assertEmpty($result->getStdOut());
     $this->assertNotEmpty($result->getStdErr());
     $this->assertGreaterThan(0, $result->getReturnCode());
 }
예제 #2
0
 public function testFileModeSwitchWithFileArgument()
 {
     $binary = new Binary('/usr/bin/git');
     $call = $binary->createGitCall('/', 'command', array('option', '/path/to/file', '--', 'path/to/file'));
     $this->assertCliCommandEquals("/usr/bin/git 'command' 'option' '/path/to/file' -- 'path/to/file'", $call->getCmd());
 }