From 8eb9584173f5c1fb83dcbd2a0953f2e4c97a887d Mon Sep 17 00:00:00 2001 From: till Date: Thu, 22 Mar 2012 17:16:41 +0100 Subject: [PATCH] * move tests from Composer\Test\Vcs\SvnDriverTest to this class --- tests/Composer/Test/Util/SvnTest.php | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/Composer/Test/Util/SvnTest.php diff --git a/tests/Composer/Test/Util/SvnTest.php b/tests/Composer/Test/Util/SvnTest.php new file mode 100644 index 000000000..2a1839f67 --- /dev/null +++ b/tests/Composer/Test/Util/SvnTest.php @@ -0,0 +1,49 @@ +getCmd(" --no-auth-cache --username 'till' --password 'test' ")), + array('http://svn.apache.org/', ''), + array('svn://johndoe@example.org', $this->getCmd(" --no-auth-cache --username 'johndoe' --password '' ")), + ); + } + + /** + * Test the credential string. + * + * @param string $url The SVN url. + * @param string $expect The expectation for the test. + * + * @dataProvider urlProvider + */ + public function testCredentials($url, $expect) + { + $svn = new Svn($url, new NullIO); + + $this->assertEquals($expect, $svn->getCredentialString()); + } + + public function testInteractiveString() + { + $url = 'http://svn.example.org'; + + $svn = new Svn($url, new NullIO()); + + $this->assertEquals( + "svn ls --non-interactive 'http://svn.example.org'", + $svn->getCommand('svn ls', $url) + ); + } +} \ No newline at end of file