Browse Source

Fixed tests

bboer 12 years ago
parent
commit
00361e0087

+ 1 - 1
src/Composer/Repository/Vcs/GitHubDriver.php

@@ -270,7 +270,7 @@ class GitHubDriver extends VcsDriver
                             // cannot ask for authentication credentials (because we
                             // are not interactive) then we fallback to GitDriver.
                             $this->gitDriver = new GitDriver(
-                                $this->generateSshUrl(),
+                                array('url' => $this->generateSshUrl()),
                                 $this->io,
                                 $this->config,
                                 $this->process,

+ 20 - 4
tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php

@@ -77,7 +77,11 @@ class GitHubDriverTest extends \PHPUnit_Framework_TestCase
             ->with($this->equalTo('github.com'), $this->equalTo($repoApiUrl), $this->equalTo(false))
             ->will($this->returnValue('{"master_branch": "test_master"}'));
 
-        $gitHubDriver = new GitHubDriver($repoUrl, $io, $this->config, $process, $remoteFilesystem);
+        $repoConfig = array(
+            'url' => $repoUrl,
+        );
+
+        $gitHubDriver = new GitHubDriver($repoConfig, $io, $this->config, $process, $remoteFilesystem);
         $gitHubDriver->initialize();
         $this->setAttribute($gitHubDriver, 'tags', array($identifier => $sha));
 
@@ -125,7 +129,11 @@ class GitHubDriverTest extends \PHPUnit_Framework_TestCase
             ->with($this->equalTo('github.com'), $this->equalTo($repoApiUrl), $this->equalTo(false))
             ->will($this->returnValue('{"master_branch": "test_master"}'));
 
-        $gitHubDriver = new GitHubDriver($repoUrl, $io, $this->config, null, $remoteFilesystem);
+        $repoConfig = array(
+            'url' => $repoUrl,
+        );
+
+        $gitHubDriver = new GitHubDriver($repoConfig, $io, $this->config, null, $remoteFilesystem);
         $gitHubDriver->initialize();
         $this->setAttribute($gitHubDriver, 'tags', array($identifier => $sha));
 
@@ -183,7 +191,11 @@ class GitHubDriverTest extends \PHPUnit_Framework_TestCase
             ->with($this->equalTo('github.com'), $this->equalTo('https://api.github.com/repos/composer/packagist/commits/feature%2F3.2-foo'), $this->equalTo(false))
             ->will($this->returnValue('{"commit": {"committer":{ "date": "2012-09-10"}}}'));
 
-        $gitHubDriver = new GitHubDriver($repoUrl, $io, $this->config, null, $remoteFilesystem);
+        $repoConfig = array(
+            'url' => $repoUrl,
+        );
+
+        $gitHubDriver = new GitHubDriver($repoConfig, $io, $this->config, null, $remoteFilesystem);
         $gitHubDriver->initialize();
         $this->setAttribute($gitHubDriver, 'tags', array($identifier => $sha));
 
@@ -271,7 +283,11 @@ class GitHubDriverTest extends \PHPUnit_Framework_TestCase
             ->method('splitLines')
             ->will($this->returnValue(array('* test_master')));
 
-        $gitHubDriver = new GitHubDriver($repoUrl, $io, $this->config, $process, $remoteFilesystem);
+        $repoConfig = array(
+            'url' => $repoUrl,
+        );
+
+        $gitHubDriver = new GitHubDriver($repoConfig, $io, $this->config, $process, $remoteFilesystem);
         $gitHubDriver->initialize();
 
         $this->assertEquals('test_master', $gitHubDriver->getRootIdentifier());

+ 5 - 1
tests/Composer/Test/Repository/Vcs/SvnDriverTest.php

@@ -45,7 +45,11 @@ class SvnDriverTest extends \PHPUnit_Framework_TestCase
                 'home' => sys_get_temp_dir() . '/composer-test',
             ),
         ));
-        $svn = new SvnDriver('http://till:secret@corp.svn.local/repo', $console, $config, $process);
+        $repoConfig = array(
+            'url' => 'http://till:secret@corp.svn.local/repo',
+        );
+
+        $svn = new SvnDriver($repoConfig, $console, $config, $process);
         $svn->initialize();
     }