示例#1
0
 /**
  * @test
  */
 public function pushingTagsToARemoteRepositoryWorks()
 {
     $this->skipTestIfGitCommandForTestingDoesNotExist();
     $expectedTagName = 'WhatATag';
     $this->remoteProxy->init()->setBare(true)->execute();
     $this->proxy->init()->execute();
     $this->proxy->remote()->add()->setName('origin')->setUrl(sprintf("file://%s", $this->remoteRepositoryRootPath))->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();
     $this->proxy->tag()->setSign(false)->setName($expectedTagName)->execute();
     $this->proxy->push()->setTags()->setRemote('origin')->setRefspec('master')->execute();
     $actual = $this->remoteProxy->log()->execute()->getRawResult();
     $expected = "[TASK] Initial commit";
     $this->assertContains($expected, $actual);
     $actualTagName = $this->runGitCommandForAssertion(sprintf("%s --git-dir=%s/.git/ tag", $this->pathToGitCommand, $this->remoteRepositoryRootPath));
     $this->assertSame($expectedTagName, trim($actualTagName));
 }
示例#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();
 }