Beispiel #1
0
 public function testCorrectOutput()
 {
     $builder = new MockCommandBuilder();
     $builder = $builder->setCommand('/usr/bin/git')->addMockResult(0, 'v0.9.0' . PHP_EOL . 'v0.9.1' . PHP_EOL, '')->addMockResult(0, '1838fa95822c8008be03dbd8c4e2c14370018cf1' . PHP_EOL, '')->addMockResult(0, 'commit 1838fa95822c8008be03dbd8c4e2c14370018cf1' . PHP_EOL . 'Author:     ptlis <*****@*****.**>' . PHP_EOL . 'AuthorDate: Fri Jul 25 18:55:15 2015 +0100' . PHP_EOL . 'Commit:     ptlis <*****@*****.**>' . PHP_EOL . 'AuthorDate: Fri Jul 25 18:55:15 2015 +0100' . PHP_EOL . '' . PHP_EOL . '    Rework the thingy' . PHP_EOL, '')->addMockResult(0, '7f202db7c7f1302d8ced7fa6fb5307320e016a3f' . PHP_EOL, '')->addMockResult(0, 'commit 7f202db7c7f1302d8ced7fa6fb5307320e016a3f' . PHP_EOL . 'Author:     ptlis <*****@*****.**>' . PHP_EOL . 'AuthorDate: Fri Jul 31 12:28:03 2015 +0100' . PHP_EOL . 'Commit:     ptlis <*****@*****.**>' . PHP_EOL . 'CommitDate: Fri Jul 31 12:28:03 2015 +0100' . PHP_EOL . '' . PHP_EOL . '    Update the FooWidget to 3.1415' . PHP_EOL, '');
     $mockExecutor = new MockCommandExecutor($builder);
     $meta = new Meta($mockExecutor);
     $actualTagList = $meta->getAllTags();
     $this->assertEquals(array(new Tag('v0.9.0', new RevisionLog('1838fa95822c8008be03dbd8c4e2c14370018cf1', 'ptlis <*****@*****.**>', new \DateTime('Fri Jul 25 18:55:15 2015 +0100'), 'Rework the thingy')), new Tag('v0.9.1', new RevisionLog('7f202db7c7f1302d8ced7fa6fb5307320e016a3f', 'ptlis <*****@*****.**>', new \DateTime('Fri Jul 31 12:28:03 2015 +0100'), 'Update the FooWidget to 3.1415'))), $actualTagList);
     $this->assertInstanceOf('\\ptlis\\Vcs\\Shared\\RevisionLog', $actualTagList[0]->getRevisionLog());
     $this->assertEquals('v0.9.0', $actualTagList[0]->getName());
 }