Skip to content

Commit f9b516e

Browse files
author
Hugo Fonseca
committed
Added a test to verify that client is kept when childfactory is invoked
1 parent 9b080cd commit f9b516e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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)