File tree Expand file tree Collapse file tree 4 files changed +20
-2
lines changed
test/Bitbucket/Tests/API/Http Expand file tree Collapse file tree 4 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 22All notable changes to this project will be documented in this file.
33This 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.
Original file line number Diff line number Diff 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 ());
Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments