示例#1
0
 /**
  * @test
  */
 public function commitOfUnmodifiedRepositoryDoesNotReturnAnError()
 {
     $this->skipTestIfGitCommandForTestingDoesNotExist();
     $this->proxy->init()->execute();
     file_put_contents(Files::concatenatePaths(array($this->repositoryRootPath, "film01.txt")), "Dr. Strangelove Or How I Stopped Worrying And Love The Bomb");
     file_put_contents(Files::concatenatePaths(array($this->repositoryRootPath, "film02.txt")), "2001 - A Space Odyssey");
     $this->proxy->add()->setPath(".")->execute();
     $this->proxy->commit()->setMessage("[TASK] Initial commit")->execute();
     $this->proxy->add()->setPath(".")->execute();
     $result = $this->proxy->commit()->setAllowEmpty(true)->setMessage("[TASK] Empty commit")->execute();
     $this->assertSame(0, $result->getExitCode());
 }
示例#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();
 }