From 082268370649bdbe1c13bf109f7d4fbdc8ce0b71 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 28 Jun 2013 20:42:06 +0200 Subject: [PATCH] Fix tests --- tests/Composer/Test/ConfigTest.php | 6 +++--- .../Composer/Test/Downloader/GitDownloaderTest.php | 13 +++---------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/Composer/Test/ConfigTest.php b/tests/Composer/Test/ConfigTest.php index cbfa42de2..c2cf82ca7 100644 --- a/tests/Composer/Test/ConfigTest.php +++ b/tests/Composer/Test/ConfigTest.php @@ -112,9 +112,9 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function testOverrideGithubProtocols() { $config = new Config(); - $config->merge(array('config' => array('github-protocols' => array('https', 'http')))); - $config->merge(array('config' => array('github-protocols' => array('http')))); + $config->merge(array('config' => array('github-protocols' => array('https', 'git')))); + $config->merge(array('config' => array('github-protocols' => array('https')))); - $this->assertEquals(array('http'), $config->get('github-protocols')); + $this->assertEquals(array('https'), $config->get('github-protocols')); } } diff --git a/tests/Composer/Test/Downloader/GitDownloaderTest.php b/tests/Composer/Test/Downloader/GitDownloaderTest.php index 569dfccbd..57e823223 100644 --- a/tests/Composer/Test/Downloader/GitDownloaderTest.php +++ b/tests/Composer/Test/Downloader/GitDownloaderTest.php @@ -107,28 +107,22 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase $expectedGitCommand = $this->winCompat("git clone 'https://github.com/composer/composer' 'composerPath' && cd 'composerPath' && git remote add composer 'https://github.com/composer/composer' && git fetch composer"); $processExecutor->expects($this->at(2)) - ->method('execute') - ->with($this->equalTo($expectedGitCommand)) - ->will($this->returnValue(1)); - - $expectedGitCommand = $this->winCompat("git clone 'http://github.com/composer/composer' 'composerPath' && cd 'composerPath' && git remote add composer 'http://github.com/composer/composer' && git fetch composer"); - $processExecutor->expects($this->at(4)) ->method('execute') ->with($this->equalTo($expectedGitCommand)) ->will($this->returnValue(0)); $expectedGitCommand = $this->winCompat("git remote set-url --push origin 'git@github.com:composer/composer.git'"); - $processExecutor->expects($this->at(5)) + $processExecutor->expects($this->at(3)) ->method('execute') ->with($this->equalTo($expectedGitCommand), $this->equalTo(null), $this->equalTo($this->winCompat('composerPath'))) ->will($this->returnValue(0)); - $processExecutor->expects($this->at(6)) + $processExecutor->expects($this->at(4)) ->method('execute') ->with($this->equalTo('git branch -r')) ->will($this->returnValue(0)); - $processExecutor->expects($this->at(7)) + $processExecutor->expects($this->at(5)) ->method('execute') ->with($this->equalTo($this->winCompat("git checkout 'ref' && git reset --hard 'ref'")), $this->equalTo(null), $this->equalTo($this->winCompat('composerPath'))) ->will($this->returnValue(0)); @@ -142,7 +136,6 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase return array( array('git', 'git@github.com:composer/composer.git'), array('https', 'https://github.com/composer/composer.git'), - array('http', 'https://github.com/composer/composer.git') ); }