Skip to content

Commit

Permalink
feat: make auth http client config extends from default client config (
Browse files Browse the repository at this point in the history
…#2348)

Co-authored-by: Brent Shaffer <[email protected]>
  • Loading branch information
geoffrey-brier and bshaffer committed Dec 19, 2022
1 parent b2624d2 commit 2640250
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
7 changes: 1 addition & 6 deletions src/AuthHandler/Guzzle6AuthHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ public function attachKey(ClientInterface $http, $key)

private function createAuthHttp(ClientInterface $http)
{
return new Client([
'base_uri' => $http->getConfig('base_uri'),
'http_errors' => true,
'verify' => $http->getConfig('verify'),
'proxy' => $http->getConfig('proxy'),
]);
return new Client(['http_errors' => true] + $http->getConfig());
}
}
8 changes: 1 addition & 7 deletions tests/Google/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -997,14 +997,8 @@ public function testCredentialsOptionWithCredentialsLoader()

$httpClient = $this->prophesize('GuzzleHttp\ClientInterface');
$httpClient->getConfig()
->shouldBeCalledOnce()
->shouldBeCalled()
->willReturn(['handler' => $handler->reveal()]);
$httpClient->getConfig('base_uri')
->shouldBeCalledOnce();
$httpClient->getConfig('verify')
->shouldBeCalledOnce();
$httpClient->getConfig('proxy')
->shouldBeCalledOnce();
$httpClient->send(Argument::any(), Argument::any())
->shouldNotBeCalled();

Expand Down

0 comments on commit 2640250

Please sign in to comment.