Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gax/src/GapicClientTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ private function setClientOptions(array $options)
$options['apiKey'],
$options['credentialsConfig']['quotaProject'] ?? null
);
} elseif ($hasEmulator && !isset($options['credentials'])) {
$this->credentialsWrapper = new InsecureCredentialsWrapper();
} else {
$enableRegionalAccessBoundary = filter_var(
getenv('GOOGLE_AUTH_TRUST_BOUNDARY_ENABLE_EXPERIMENT'),
Expand Down
5 changes: 5 additions & 0 deletions Gax/tests/Unit/GapicClientTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1861,6 +1861,7 @@ public function testHasEmulatorOption()
use GapicClientTrait {
buildClientOptions as public;
setClientOptions as public;
getCredentialsWrapper as public;
}
use ClientDefaultsTrait {
ClientDefaultsTrait::getClientDefaults insteadof GapicClientTrait;
Expand All @@ -1881,6 +1882,10 @@ private function createTransport(
$gapic->setClientOptions($options);

$this->assertTrue($gapic->hasEmulator);
$this->assertInstanceOf(
\Google\ApiCore\InsecureCredentialsWrapper::class,
$gapic->getCredentialsWrapper()
);
}

public function testGetServiceScopes()
Expand Down
Loading