Fix tests

main
Jordi Boggiano 11 years ago
parent e68d455c5c
commit 0822683706

@ -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'));
}
}

@ -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')
);
}

Loading…
Cancel
Save