Browse Source

Cross platform test fixes

Jordi Boggiano 13 years ago
parent
commit
3aabb4784c
1 changed files with 12 additions and 3 deletions
  1. 12 3
      tests/Composer/Test/Repository/Vcs/SvnDriverTest.php

+ 12 - 3
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;
+    }
 }