Skip to content

Commit

Permalink
Merge branch 'release/0.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
vimishor committed Nov 7, 2015
2 parents 93b554f + a9fc1ce commit c3de78a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.7.0] / 2015-09-08
## 0.7.1 / 2015-11-07

### Fixed:
- HTTP Client options where not forwarded to child classes. (PR #26)

## 0.7.0 / 2015-09-08

### Added:
- Implemented webhooks endpoints.
Expand Down
1 change: 1 addition & 0 deletions lib/Bitbucket/API/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ protected function childFactory($name)
/** @var Api $child */
$class = '\\Bitbucket\\API\\'.$name;
$child = new $class($this->client);
$child->setClient($this->getClient());

if ($this->getClient()->hasListeners()) {
$child->getClient()->setListeners($this->getClient()->getListeners());
Expand Down
2 changes: 1 addition & 1 deletion lib/Bitbucket/API/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Client extends ClientListener implements ClientInterface
'api_versions' => array('1.0', '2.0'), // supported versions
'format' => 'json',
'formats' => array('json', 'xml'), // supported response formats
'user_agent' => 'bitbucket-api-php/0.7.0 (https://bitbucket.org/gentlero/bitbucket-api)',
'user_agent' => 'bitbucket-api-php/0.7.1 (https://bitbucket.org/gentlero/bitbucket-api)',
'timeout' => 10,
'verify_peer' => false
);
Expand Down
12 changes: 12 additions & 0 deletions test/Bitbucket/Tests/API/Http/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ public function testShouldDoPatchRequestAndReturnResponseInstance()
$this->assertInstanceOf('\Buzz\Message\MessageInterface', $response);
}

public function testClientIsKeptWhenInvokingChildFactory()
{
$options = [
'base_url' => 'localhost'
];
$client = new Client($options);
$pullRequest = new \Bitbucket\API\Repositories\PullRequests();
$pullRequest->setClient($client);
$comments = $pullRequest->comments();
$this->assertSame($client, $comments->getClient());
}

public function testAddListener()
{
$listener = $this->getListenerMock();
Expand Down

0 comments on commit c3de78a

Please sign in to comment.