From c2d15e6c3bd8a29bae89d184a999ddac15fcb807 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 1 May 2016 22:29:51 -0400 Subject: New plugin repo is cloned to /store/pluginrepos/REPONAME for analysis --- .../git/test/PHPGit/Command/TagCommandTest.php | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 library/kzykhys/git/test/PHPGit/Command/TagCommandTest.php (limited to 'library/kzykhys/git/test/PHPGit/Command/TagCommandTest.php') diff --git a/library/kzykhys/git/test/PHPGit/Command/TagCommandTest.php b/library/kzykhys/git/test/PHPGit/Command/TagCommandTest.php new file mode 100644 index 000000000..5715ba92e --- /dev/null +++ b/library/kzykhys/git/test/PHPGit/Command/TagCommandTest.php @@ -0,0 +1,58 @@ +init($this->directory); + $git->setRepository($this->directory); + $filesystem->dumpFile($this->directory . '/README.md', 'hello'); + $git->add('.'); + $git->commit('Initial commit'); + $git->tag->create('v1.0.0'); + $git->tag->delete('v1.0.0'); + $this->assertCount(0, $git->tag()); + } + + /** + * @expectedException \PHPGit\Exception\GitException + */ + public function testTagVerify() + { + $filesystem = new Filesystem(); + + $git = new Git(); + $git->init($this->directory); + $git->setRepository($this->directory); + $filesystem->dumpFile($this->directory . '/README.md', 'hello'); + $git->add('.'); + $git->commit('Initial commit'); + $git->tag->create('v1.0.0'); + $git->tag->verify('v1.0.0'); + } + + public function testCreateTagFromCommit() + { + $filesystem = new Filesystem(); + + $git = new Git(); + $git->init($this->directory); + $git->setRepository($this->directory); + $filesystem->dumpFile($this->directory . '/README.md', 'hello'); + $git->add('.'); + $git->commit('Initial commit'); + $log = $git->log(null, null, array('limit' => 1)); + $git->tag->create('v1.0.0', $log[0]['hash']); + $this->assertCount(1, $git->tag()); + } + +} \ No newline at end of file -- cgit v1.2.3