Skip to content

Commit c3de78a

Browse files
committed
Merge branch 'release/0.7.1'
2 parents 93b554f + a9fc1ce commit c3de78a

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5-
## [0.7.0] / 2015-09-08
5+
## 0.7.1 / 2015-11-07
6+
7+
### Fixed:
8+
- HTTP Client options where not forwarded to child classes. (PR #26)
9+
10+
## 0.7.0 / 2015-09-08
611

712
### Added:
813
- Implemented webhooks endpoints.

lib/Bitbucket/API/Api.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ protected function childFactory($name)
295295
/** @var Api $child */
296296
$class = '\\Bitbucket\\API\\'.$name;
297297
$child = new $class($this->client);
298+
$child->setClient($this->getClient());
298299

299300
if ($this->getClient()->hasListeners()) {
300301
$child->getClient()->setListeners($this->getClient()->getListeners());

lib/Bitbucket/API/Http/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Client extends ClientListener implements ClientInterface
3333
'api_versions' => array('1.0', '2.0'), // supported versions
3434
'format' => 'json',
3535
'formats' => array('json', 'xml'), // supported response formats
36-
'user_agent' => 'bitbucket-api-php/0.7.0 (https://bitbucket.org/gentlero/bitbucket-api)',
36+
'user_agent' => 'bitbucket-api-php/0.7.1 (https://bitbucket.org/gentlero/bitbucket-api)',
3737
'timeout' => 10,
3838
'verify_peer' => false
3939
);

test/Bitbucket/Tests/API/Http/ClientTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ public function testShouldDoPatchRequestAndReturnResponseInstance()
135135
$this->assertInstanceOf('\Buzz\Message\MessageInterface', $response);
136136
}
137137

138+
public function testClientIsKeptWhenInvokingChildFactory()
139+
{
140+
$options = [
141+
'base_url' => 'localhost'
142+
];
143+
$client = new Client($options);
144+
$pullRequest = new \Bitbucket\API\Repositories\PullRequests();
145+
$pullRequest->setClient($client);
146+
$comments = $pullRequest->comments();
147+
$this->assertSame($client, $comments->getClient());
148+
}
149+
138150
public function testAddListener()
139151
{
140152
$listener = $this->getListenerMock();

0 commit comments

Comments
 (0)