1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Fix tests

This commit is contained in:
Jordi Boggiano 2012-10-18 18:43:31 +02:00
parent cf0753e062
commit e0ce22f7cc
4 changed files with 36 additions and 10 deletions

View file

@ -68,14 +68,22 @@ class GitHubDriverTest extends \PHPUnit_Framework_TestCase
->with($this->equalTo('Password: '))
->will($this->returnValue('somepassword'));
$io->expects($this->once())
$io->expects($this->any())
->method('setAuthorization')
->with($this->equalTo('github.com'), 'someuser', 'somepassword');
->with($this->equalTo('github.com'), $this->matchesRegularExpression('{someuser|abcdef}'), $this->matchesRegularExpression('{somepassword|x-oauth-basic}'));
$remoteFilesystem->expects($this->at(1))
->method('getContents')
->with($this->equalTo('github.com'), $this->equalTo('https://api.github.com/authorizations'), $this->equalTo(false))
->will($this->returnValue('{"token": "abcdef"}'));
$remoteFilesystem->expects($this->at(2))
->method('getContents')
->with($this->equalTo('github.com'), $this->equalTo($repoApiUrl), $this->equalTo(false))
->will($this->returnValue('{"master_branch": "test_master"}'));
->will($this->returnValue('{"master_branch": "test_master", "private": true}'));
$configSource = $this->getMock('Composer\Config\ConfigSourceInterface');
$this->config->setConfigSource($configSource);
$gitHubDriver = new GitHubDriver($repoUrl, $io, $this->config, $process, $remoteFilesystem);
$gitHubDriver->initialize();