Skip to content

Commit ecd6ac2

Browse files
committed
chore: Add bogus private key dynamically
1 parent d25fb6f commit ecd6ac2

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

Core/tests/Unit/ClientTraitTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ public function testConfigureAuthenticationWithKeyFilePath()
168168

169169
public function testIgnoreKeyFileWhenUsingCredentialsFetcher()
170170
{
171-
$credentials = new ServiceAccountCredentials([], Fixtures::SERVICE_ACCOUNT_FIXTURE());
171+
$keyFilePath = Fixtures::SERVICE_ACCOUNT_FIXTURE();
172+
$key = json_decode(file_get_contents($keyFilePath), true);
173+
$key['private_key'] = 'xxx';
174+
175+
$credentials = new ServiceAccountCredentials([], $key);
172176

173177
$conf = $this->impl->call('configureAuthentication', [[
174178
'credentialsFetcher' => $credentials,
@@ -179,7 +183,11 @@ public function testIgnoreKeyFileWhenUsingCredentialsFetcher()
179183

180184
public function testGetProjectIdFromCredentialsFetcher()
181185
{
182-
$credentials = new ServiceAccountCredentials([], Fixtures::SERVICE_ACCOUNT_FIXTURE());
186+
$keyFilePath = Fixtures::SERVICE_ACCOUNT_FIXTURE();
187+
$key = json_decode(file_get_contents($keyFilePath), true);
188+
$key['private_key'] = 'xxx';
189+
190+
$credentials = new ServiceAccountCredentials([], $key);
183191

184192
$this->impl->call('configureAuthentication', [[
185193
'credentialsFetcher' => $credentials,

0 commit comments

Comments
 (0)