aboutsummaryrefslogtreecommitdiffstats
path: root/library/kzykhys/git/test/PHPGit/Command/Remote/SetUrlCommandTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/kzykhys/git/test/PHPGit/Command/Remote/SetUrlCommandTest.php')
-rw-r--r--library/kzykhys/git/test/PHPGit/Command/Remote/SetUrlCommandTest.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/library/kzykhys/git/test/PHPGit/Command/Remote/SetUrlCommandTest.php b/library/kzykhys/git/test/PHPGit/Command/Remote/SetUrlCommandTest.php
new file mode 100644
index 000000000..b70b67d40
--- /dev/null
+++ b/library/kzykhys/git/test/PHPGit/Command/Remote/SetUrlCommandTest.php
@@ -0,0 +1,46 @@
+<?php
+
+use PHPGit\Git;
+
+require_once __DIR__ . '/../../BaseTestCase.php';
+
+class SetUrlCommandTest extends BaseTestCase
+{
+
+ public function testSetUrl()
+ {
+ $git = new Git();
+ $git->init($this->directory);
+ $git->setRepository($this->directory);
+ $git->remote->add('origin', 'http://example.com/test.git');
+ $git->remote->url('origin', 'https://github.com/kzykhys/Text.git', 'http://example.com/test.git');
+
+ $remotes = $git->remote();
+
+ $this->assertEquals('https://github.com/kzykhys/Text.git', $remotes['origin']['fetch']);
+ }
+
+ public function testSetUrlAdd()
+ {
+ $git = new Git();
+ $git->init($this->directory);
+ $git->setRepository($this->directory);
+ $git->remote->add('origin', 'http://example.com/test.git');
+ $git->remote->url->add('origin', 'https://github.com/kzykhys/Text.git');
+ }
+
+ public function testSetUrlDelete()
+ {
+ $git = new Git();
+ $git->init($this->directory);
+ $git->setRepository($this->directory);
+ $git->remote->add('origin', 'http://example.com/test.git');
+ $git->remote->url->add('origin', 'https://github.com/kzykhys/Text.git');
+ $git->remote->url->delete('origin', 'https://github.com');
+
+ $remotes = $git->remote();
+
+ $this->assertEquals('http://example.com/test.git', $remotes['origin']['fetch']);
+ }
+
+} \ No newline at end of file