@@ -54,14 +54,14 @@ public function testGetCredentialsFailsIfEnvSpecifiesNonExistentFile()
5454 {
5555 $ this ->expectException (DomainException::class);
5656
57- $ keyFile = __DIR__ . '/fixtures ' . ' /does-not-exist-private.json ' ;
57+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /does-not-exist-private.json ' ;
5858 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
5959 ApplicationDefaultCredentials::getCredentials ('a scope ' );
6060 }
6161
6262 public function testLoadsOKIfEnvSpecifiedIsValid ()
6363 {
64- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
64+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
6565 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
6666 $ this ->assertNotNull (
6767 ApplicationDefaultCredentials::getCredentials ('a scope ' )
@@ -70,7 +70,7 @@ public function testLoadsOKIfEnvSpecifiedIsValid()
7070
7171 public function testLoadsDefaultFileIfPresentAndEnvVarIsNotSet ()
7272 {
73- setHomeEnv (__DIR__ . '/fixtures ' );
73+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
7474 $ this ->assertNotNull (
7575 ApplicationDefaultCredentials::getCredentials ('a scope ' )
7676 );
@@ -159,7 +159,7 @@ public function testGceCredentials()
159159
160160 public function testImpersonatedServiceAccountCredentials ()
161161 {
162- setHomeEnv (__DIR__ . '/fixtures5 ' );
162+ setHomeEnv (__DIR__ . '/fixtures/ fixtures5 ' );
163163 $ creds = ApplicationDefaultCredentials::getCredentials (
164164 null ,
165165 null ,
@@ -181,7 +181,7 @@ public function testImpersonatedServiceAccountCredentials()
181181
182182 public function testUserRefreshCredentials ()
183183 {
184- setHomeEnv (__DIR__ . '/fixtures2 ' );
184+ setHomeEnv (__DIR__ . '/fixtures/ fixtures2 ' );
185185
186186 $ creds = ApplicationDefaultCredentials::getCredentials (
187187 null , // $scope
@@ -216,7 +216,7 @@ public function testUserRefreshCredentials()
216216
217217 public function testServiceAccountCredentials ()
218218 {
219- setHomeEnv (__DIR__ . '/fixtures ' );
219+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
220220
221221 $ creds = ApplicationDefaultCredentials::getCredentials (
222222 null , // $scope
@@ -251,7 +251,7 @@ public function testServiceAccountCredentials()
251251
252252 public function testDefaultScopeArray ()
253253 {
254- setHomeEnv (__DIR__ . '/fixtures2 ' );
254+ setHomeEnv (__DIR__ . '/fixtures/ fixtures2 ' );
255255
256256 $ creds = ApplicationDefaultCredentials::getCredentials (
257257 null , // $scope
@@ -273,21 +273,21 @@ public function testGetMiddlewareFailsIfEnvSpecifiesNonExistentFile()
273273 {
274274 $ this ->expectException (DomainException::class);
275275
276- $ keyFile = __DIR__ . '/fixtures ' . ' /does-not-exist-private.json ' ;
276+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /does-not-exist-private.json ' ;
277277 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
278278 ApplicationDefaultCredentials::getMiddleware ('a scope ' );
279279 }
280280
281281 public function testGetMiddlewareLoadsOKIfEnvSpecifiedIsValid ()
282282 {
283- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
283+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
284284 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
285285 $ this ->assertNotNull (ApplicationDefaultCredentials::getMiddleware ('a scope ' ));
286286 }
287287
288288 public function testLGetMiddlewareoadsDefaultFileIfPresentAndEnvVarIsNotSet ()
289289 {
290- setHomeEnv (__DIR__ . '/fixtures ' );
290+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
291291 $ this ->assertNotNull (ApplicationDefaultCredentials::getMiddleware ('a scope ' ));
292292 }
293293
@@ -309,7 +309,7 @@ public function testGetMiddlewareFailsIfNotOnGceAndNoDefaultFileFound()
309309
310310 public function testGetMiddlewareWithCacheOptions ()
311311 {
312- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
312+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
313313 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
314314
315315 $ httpHandler = getHandler ([
@@ -452,14 +452,14 @@ public function testGetIdTokenCredentialsFailsIfEnvSpecifiesNonExistentFile()
452452 {
453453 $ this ->expectException (DomainException::class);
454454
455- $ keyFile = __DIR__ . '/fixtures ' . ' /does-not-exist-private.json ' ;
455+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /does-not-exist-private.json ' ;
456456 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
457457 ApplicationDefaultCredentials::getIdTokenCredentials ($ this ->targetAudience );
458458 }
459459
460460 public function testGetIdTokenCredentialsLoadsOKIfEnvSpecifiedIsValid ()
461461 {
462- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
462+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
463463 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
464464
465465 $ creds = ApplicationDefaultCredentials::getIdTokenCredentials ($ this ->targetAudience );
@@ -468,7 +468,7 @@ public function testGetIdTokenCredentialsLoadsOKIfEnvSpecifiedIsValid()
468468
469469 public function testGetIdTokenCredentialsLoadsDefaultFileIfPresentAndEnvVarIsNotSet ()
470470 {
471- setHomeEnv (__DIR__ . '/fixtures ' );
471+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
472472 $ creds = ApplicationDefaultCredentials::getIdTokenCredentials ($ this ->targetAudience );
473473 $ this ->assertInstanceOf (ServiceAccountCredentials::class, $ creds );
474474 }
@@ -495,14 +495,14 @@ public function testGetIdTokenCredentialsFailsIfNotOnGceAndNoDefaultFileFound()
495495
496496 public function testGetIdTokenCredentialsWithImpersonatedServiceAccountCredentials ()
497497 {
498- setHomeEnv (__DIR__ . '/fixtures5 ' );
498+ setHomeEnv (__DIR__ . '/fixtures/ fixtures5 ' );
499499 $ creds = ApplicationDefaultCredentials::getIdTokenCredentials ('123@456.com ' );
500500 $ this ->assertInstanceOf (ImpersonatedServiceAccountCredentials::class, $ creds );
501501 }
502502
503503 public function testGetIdTokenCredentialsWithCacheOptions ()
504504 {
505- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
505+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
506506 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
507507
508508 $ httpHandler = getHandler ([
@@ -548,7 +548,7 @@ public function testGetIdTokenCredentialsSuccedsIfNoDefaultFilesButIsOnGCE()
548548
549549 public function testGetIdTokenCredentialsWithUserRefreshCredentials ()
550550 {
551- setHomeEnv (__DIR__ . '/fixtures2 ' );
551+ setHomeEnv (__DIR__ . '/fixtures/ fixtures2 ' );
552552
553553 $ creds = ApplicationDefaultCredentials::getIdTokenCredentials (
554554 $ this ->targetAudience ,
@@ -567,7 +567,7 @@ public function testGetIdTokenCredentialsWithUserRefreshCredentials()
567567
568568 public function testWithServiceAccountCredentialsAndExplicitQuotaProject ()
569569 {
570- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
570+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
571571 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
572572
573573 $ credentials = ApplicationDefaultCredentials::getCredentials (
@@ -588,7 +588,7 @@ public function testWithServiceAccountCredentialsAndExplicitQuotaProject()
588588
589589 public function testGetCredentialsUtilizesQuotaProjectInKeyFile ()
590590 {
591- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
591+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
592592 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
593593
594594 $ credentials = ApplicationDefaultCredentials::getCredentials ();
@@ -604,7 +604,7 @@ public function testGetCredentialsUtilizesQuotaProjectEnvVar()
604604 {
605605 $ quotaProject = 'quota-project-from-env-var ' ;
606606 putenv (CredentialsLoader::QUOTA_PROJECT_ENV_VAR . '= ' . $ quotaProject );
607- setHomeEnv (__DIR__ . '/fixtures ' );
607+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
608608
609609 $ credentials = ApplicationDefaultCredentials::getCredentials ();
610610
@@ -619,7 +619,7 @@ public function testGetCredentialsUtilizesQuotaProjectParameterOverEnvVar()
619619 {
620620 $ quotaProject = 'quota-project-from-parameter ' ;
621621 putenv (CredentialsLoader::QUOTA_PROJECT_ENV_VAR . '=quota-project-from-env-var ' );
622- setHomeEnv (__DIR__ . '/fixtures ' );
622+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
623623
624624 $ credentials = ApplicationDefaultCredentials::getCredentials (
625625 null , // $scope
@@ -640,7 +640,7 @@ public function testGetCredentialsUtilizesQuotaProjectParameterOverEnvVar()
640640 public function testGetCredentialsUtilizesQuotaProjectEnvVarOverKeyFile ()
641641 {
642642 $ quotaProject = 'quota-project-from-env-var ' ;
643- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
643+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
644644 putenv (CredentialsLoader::QUOTA_PROJECT_ENV_VAR . '= ' . $ quotaProject );
645645 putenv (CredentialsLoader::ENV_VAR . '= ' . $ keyFile );
646646
@@ -654,7 +654,7 @@ public function testGetCredentialsUtilizesQuotaProjectEnvVarOverKeyFile()
654654
655655 public function testWithFetchAuthTokenCacheAndExplicitQuotaProject ()
656656 {
657- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
657+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
658658 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
659659
660660 $ httpHandler = getHandler ([
@@ -756,7 +756,7 @@ public function testAppEngineFlexibleIdToken()
756756 */
757757 public function testExternalAccountCredentials (string $ jsonFile , string $ expectedCredSource )
758758 {
759- putenv (sprintf ('GOOGLE_APPLICATION_CREDENTIALS=%s/fixtures6/%s ' , __DIR__ , $ jsonFile ));
759+ putenv (sprintf ('GOOGLE_APPLICATION_CREDENTIALS=%s/fixtures/ fixtures6/%s ' , __DIR__ , $ jsonFile ));
760760
761761 $ creds = ApplicationDefaultCredentials::getCredentials ('a_scope ' );
762762
@@ -827,19 +827,19 @@ public function provideExternalAccountCredentials()
827827 public function testUniverseDomainInKeyFile ()
828828 {
829829 // Test no universe domain in keyfile defaults to "googleapis.com"
830- $ keyFile = __DIR__ . '/fixtures3/service_account_credentials.json ' ;
830+ $ keyFile = __DIR__ . '/fixtures/ fixtures3/service_account_credentials.json ' ;
831831 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
832832 $ creds = ApplicationDefaultCredentials::getCredentials ();
833833 $ this ->assertEquals (CredentialsLoader::DEFAULT_UNIVERSE_DOMAIN , $ creds ->getUniverseDomain ());
834834
835835 // Test universe domain in "service_account" keyfile
836- $ keyFile = __DIR__ . '/fixtures/private.json ' ;
836+ $ keyFile = __DIR__ . '/fixtures/fixtures1/ private.json ' ;
837837 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
838838 $ creds = ApplicationDefaultCredentials::getCredentials ();
839839 $ this ->assertEquals ('example-universe.com ' , $ creds ->getUniverseDomain ());
840840
841841 // Test universe domain in "authenticated_user" keyfile is not read.
842- $ keyFile = __DIR__ . '/fixtures2/private.json ' ;
842+ $ keyFile = __DIR__ . '/fixtures/ fixtures2/private.json ' ;
843843 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
844844 $ creds2 = ApplicationDefaultCredentials::getCredentials ();
845845 $ this ->assertEquals (CredentialsLoader::DEFAULT_UNIVERSE_DOMAIN , $ creds2 ->getUniverseDomain ());
0 commit comments