From 3aabb4784c1d8e6ba5e1fc5306f1ac758316f86b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 8 Mar 2012 18:19:31 +0100 Subject: [PATCH] Cross platform test fixes --- .../Test/Repository/Vcs/SvnDriverTest.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php index 7d4578930..e9734eab6 100644 --- a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php @@ -25,12 +25,12 @@ class SvnDriverTest extends \PHPUnit_Framework_TestCase * * @return array */ - public static function urlProvider() + public function urlProvider() { return array( - array('http://till:test@svn.example.org/', " --no-auth-cache --username 'till' --password 'test' "), + array('http://till:test@svn.example.org/', $this->getCmd(" --no-auth-cache --username 'till' --password 'test' ")), array('http://svn.apache.org/', ''), - array('svn://johndoe@example.org', " --no-auth-cache --username 'johndoe' --password '' "), + array('svn://johndoe@example.org', $this->getCmd(" --no-auth-cache --username 'johndoe' --password '' ")), ); } @@ -44,4 +44,13 @@ class SvnDriverTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expect, $svn->getSvnCredentialString()); } + + private function getCmd($cmd) + { + if (defined('PHP_WINDOWS_VERSION_BUILD')) { + return strtr($cmd, "'", '"'); + } + + return $cmd; + } }