From 00361e00875e12e4ab38a4b5d37c44c1c3034e7c Mon Sep 17 00:00:00 2001 From: bboer Date: Fri, 31 Aug 2012 08:12:20 +0200 Subject: [PATCH] Fixed tests --- src/Composer/Repository/Vcs/GitHubDriver.php | 2 +- .../Test/Repository/Vcs/GitHubDriverTest.php | 24 +++++++++++++++---- .../Test/Repository/Vcs/SvnDriverTest.php | 6 ++++- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/Composer/Repository/Vcs/GitHubDriver.php b/src/Composer/Repository/Vcs/GitHubDriver.php index 58cfd82d9..c9004f4ac 100755 --- a/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/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, diff --git a/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php b/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php index d8fdebd07..fe0ed6141 100644 --- a/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php +++ b/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()); diff --git a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php index bf96e0f3a..d40d3f07a 100644 --- a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php +++ b/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(); }