1
0
Fork 0

Update unit test for Bitbucket util

pull/5485/head
Stefan Grootscholten 2016-07-02 17:03:01 +02:00
parent 5a31c75289
commit 9b00713a67
1 changed files with 17 additions and 2 deletions

View File

@ -164,10 +164,11 @@ class BitbucketTest extends \PHPUnit_Framework_TestCase
->willReturn(sprintf('{}', $this->token)) ->willReturn(sprintf('{}', $this->token))
; ;
$authJson = $this->getAuthJsonMock();
$this->config $this->config
->expects($this->exactly(2)) ->expects($this->exactly(3))
->method('getAuthConfigSource') ->method('getAuthConfigSource')
->willReturn($this->getAuthJsonMock()) ->willReturn($authJson)
; ;
$this->config $this->config
->expects($this->once()) ->expects($this->once())
@ -175,6 +176,20 @@ class BitbucketTest extends \PHPUnit_Framework_TestCase
->willReturn($this->getConfJsonMock()) ->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)); $this->assertTrue($this->bitbucket->authorizeOAuthInteractively($this->origin, $this->message));
} }