aboutsummaryrefslogtreecommitdiffstats
path: root/library/kzykhys/git/test/PHPGit/Command/FetchCommandTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/kzykhys/git/test/PHPGit/Command/FetchCommandTest.php')
-rw-r--r--library/kzykhys/git/test/PHPGit/Command/FetchCommandTest.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/library/kzykhys/git/test/PHPGit/Command/FetchCommandTest.php b/library/kzykhys/git/test/PHPGit/Command/FetchCommandTest.php
new file mode 100644
index 000000000..f52943099
--- /dev/null
+++ b/library/kzykhys/git/test/PHPGit/Command/FetchCommandTest.php
@@ -0,0 +1,36 @@
+<?php
+
+use PHPGit\Git;
+
+require_once __DIR__ . '/../BaseTestCase.php';
+
+class FetchCommandTest extends BaseTestCase
+{
+
+ public function testFetch()
+ {
+ $git = new Git();
+ $git->init($this->directory);
+ $git->setRepository($this->directory);
+
+ $git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
+ $git->fetch('origin', '+refs/heads/*:refs/remotes/origin/*');
+
+ $tags = $git->tag();
+ $this->assertContains('v1.0.0', $tags);
+ }
+
+ public function testFetchAll()
+ {
+ $git = new Git();
+ $git->init($this->directory);
+ $git->setRepository($this->directory);
+
+ $git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
+ $git->fetch->all();
+
+ $tags = $git->tag();
+ $this->assertContains('v1.0.0', $tags);
+ }
+
+} \ No newline at end of file