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/AddCommandTest.php | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 library/kzykhys/git/test/PHPGit/Command/AddCommandTest.php (limited to 'library/kzykhys/git/test/PHPGit/Command/AddCommandTest.php') diff --git a/library/kzykhys/git/test/PHPGit/Command/AddCommandTest.php b/library/kzykhys/git/test/PHPGit/Command/AddCommandTest.php new file mode 100644 index 000000000..1fad08417 --- /dev/null +++ b/library/kzykhys/git/test/PHPGit/Command/AddCommandTest.php @@ -0,0 +1,42 @@ + + */ +class AddCommandTest extends BaseTestCase +{ + + public function testAdd() + { + $filesystem = new Filesystem(); + $filesystem->mkdir($this->directory); + + $git = new Git(); + $git->init($this->directory); + $git->setRepository($this->directory); + + $filesystem->dumpFile($this->directory . '/test.txt', 'foo'); + $filesystem->dumpFile($this->directory . '/test.md', '**foo**'); + + $this->assertTrue($git->add('test.txt')); + $this->assertTrue($git->add(array('test.md'), array('force' => true))); + } + + /** + * @expectedException \PHPGit\Exception\GitException + * @expectedExceptionCode 128 + */ + public function testException() + { + $git = new Git(); + $git->init($this->directory); + $git->setRepository($this->directory); + $git->add('foo'); + } + +} \ No newline at end of file -- cgit v1.2.3