diff --git a/tests/Composer/Test/Util/BitbucketTest.php b/tests/Composer/Test/Util/BitbucketTest.php index 9f6cd2a5f..45b4ce752 100644 --- a/tests/Composer/Test/Util/BitbucketTest.php +++ b/tests/Composer/Test/Util/BitbucketTest.php @@ -164,10 +164,11 @@ class BitbucketTest extends \PHPUnit_Framework_TestCase ->willReturn(sprintf('{}', $this->token)) ; + $authJson = $this->getAuthJsonMock(); $this->config - ->expects($this->exactly(2)) + ->expects($this->exactly(3)) ->method('getAuthConfigSource') - ->willReturn($this->getAuthJsonMock()) + ->willReturn($authJson) ; $this->config ->expects($this->once()) @@ -175,6 +176,20 @@ class BitbucketTest extends \PHPUnit_Framework_TestCase ->willReturn($this->getConfJsonMock()) ; + $authJson->expects($this->once()) + ->method('addConfigSetting') + ->with( + 'bitbucket-oauth.'.$this->origin, + array( + 'consumer-key' => $this->consumer_key, + 'consumer-secret' => $this->consumer_secret + ) + ); + + $authJson->expects($this->once()) + ->method('removeConfigSetting') + ->with('http-basic.'.$this->origin); + $this->assertTrue($this->bitbucket->authorizeOAuthInteractively($this->origin, $this->message)); }