コード例 #1
0
 /**
  * @test
  */
 public function checkShortGitStatusOutput()
 {
     $this->skipTestIfGitCommandForTestingDoesNotExist();
     $this->proxy->init()->execute();
     file_put_contents($this->repositoryRootPath . DIRECTORY_SEPARATOR . "film01.txt", "Dr. Strangelove Or How I Stopped Worrying And Love The Bomb");
     file_put_contents($this->repositoryRootPath . DIRECTORY_SEPARATOR . "film02.txt", "2001 - A Space Odyssey");
     $this->proxy->add()->setPath(".")->execute();
     $this->proxy->commit()->setMessage("[TASK] Initial commit")->execute();
     unlink($this->repositoryRootPath . DIRECTORY_SEPARATOR . "film02.txt");
     file_put_contents($this->repositoryRootPath . DIRECTORY_SEPARATOR . "film01.txt", "Lolita");
     file_put_contents($this->repositoryRootPath . DIRECTORY_SEPARATOR . "film03.txt", "A Clockwork Orange");
     $expected = " M film01.txt\n D film02.txt\n?? film03.txt\n";
     $actual = $this->proxy->status()->setShort(true)->execute();
     $this->assertSame($expected, $actual->getRawResult());
 }
コード例 #2
0
 /**
  * @test
  */
 public function commandRendersValidCommand()
 {
     $this->prepareShellCommandExpectations();
     $this->proxy->cloneRepository()->setRepository('file:///path/to/a/repository/of/chocolate.git')->setDirectory('/path/to/checked/out/chocolate/')->execute();
     $this->proxy->cloneRepository()->setRepository('file:///path/to/a/repository/of/chocolate.git')->setDirectory('/path/to/checked/out/chocolate/')->setDepth(1)->setBranch('YummyTag')->execute();
     $this->proxy->checkout()->setForce(true)->setQuiet(true)->setCommit('c0ca3ae2f34ef4dc024093f92547b43a4d9bd58a')->execute();
     $this->proxy->log()->setMaxCount(10)->execute();
     $this->proxy->log()->setFormat('%H')->execute();
     $this->proxy->config()->setGlobal(true)->setUserName('Bud Spencer')->execute();
     $this->proxy->config()->setGlobal(true)->setEmail('*****@*****.**')->execute();
     $this->proxy->remote()->remove()->setName('origin')->execute();
     $this->proxy->remote()->add()->setName('origin')->setUrl('file:///tmp/punktde.git')->execute();
     $this->proxy->init()->setBare(true)->setShared(true)->execute();
     $this->proxy->push()->setTags()->setRemote('origin')->setRefspec('master')->execute();
     $this->proxy->tag()->setName('v1.2.3')->setSign(true)->setAnnotate(true)->setMessage('Release')->execute();
     $this->proxy->commit()->setAllowEmpty(true)->setMessage('This is a very empty commit!')->execute();
     $this->proxy->commit()->setMessage('This is a very cool message!')->execute();
     $this->proxy->add()->setPath('.')->setAll(true)->execute();
     $this->proxy->status()->setShort(true)->execute();
     $this->proxy->log()->setNameOnly(true)->execute();
 }