@@ -59,14 +59,14 @@ public function testGetCredentialsFailsIfEnvSpecifiesNonExistentFile()
5959 {
6060 $ this ->expectException (DomainException::class);
6161
62- $ keyFile = __DIR__ . '/fixtures ' . ' /does-not-exist-private.json ' ;
62+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /does-not-exist-private.json ' ;
6363 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
6464 ApplicationDefaultCredentials::getCredentials ('a scope ' );
6565 }
6666
6767 public function testLoadsOKIfEnvSpecifiedIsValid ()
6868 {
69- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
69+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
7070 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
7171 $ this ->assertNotNull (
7272 ApplicationDefaultCredentials::getCredentials ('a scope ' )
@@ -75,7 +75,7 @@ public function testLoadsOKIfEnvSpecifiedIsValid()
7575
7676 public function testLoadsDefaultFileIfPresentAndEnvVarIsNotSet ()
7777 {
78- setHomeEnv (__DIR__ . '/fixtures ' );
78+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
7979 $ this ->assertNotNull (
8080 ApplicationDefaultCredentials::getCredentials ('a scope ' )
8181 );
@@ -164,7 +164,7 @@ public function testGceCredentials()
164164
165165 public function testImpersonatedServiceAccountCredentials ()
166166 {
167- setHomeEnv (__DIR__ . '/fixtures5 ' );
167+ setHomeEnv (__DIR__ . '/fixtures/ fixtures5 ' );
168168 $ creds = ApplicationDefaultCredentials::getCredentials (
169169 null ,
170170 null ,
@@ -186,7 +186,7 @@ public function testImpersonatedServiceAccountCredentials()
186186
187187 public function testUserRefreshCredentials ()
188188 {
189- setHomeEnv (__DIR__ . '/fixtures2 ' );
189+ setHomeEnv (__DIR__ . '/fixtures/ fixtures2 ' );
190190
191191 $ creds = ApplicationDefaultCredentials::getCredentials (
192192 null , // $scope
@@ -221,7 +221,7 @@ public function testUserRefreshCredentials()
221221
222222 public function testServiceAccountCredentials ()
223223 {
224- setHomeEnv (__DIR__ . '/fixtures ' );
224+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
225225
226226 $ creds = ApplicationDefaultCredentials::getCredentials (
227227 null , // $scope
@@ -256,7 +256,7 @@ public function testServiceAccountCredentials()
256256
257257 public function testDefaultScopeArray ()
258258 {
259- setHomeEnv (__DIR__ . '/fixtures2 ' );
259+ setHomeEnv (__DIR__ . '/fixtures/ fixtures2 ' );
260260
261261 $ creds = ApplicationDefaultCredentials::getCredentials (
262262 null , // $scope
@@ -278,21 +278,21 @@ public function testGetMiddlewareFailsIfEnvSpecifiesNonExistentFile()
278278 {
279279 $ this ->expectException (DomainException::class);
280280
281- $ keyFile = __DIR__ . '/fixtures ' . ' /does-not-exist-private.json ' ;
281+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /does-not-exist-private.json ' ;
282282 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
283283 ApplicationDefaultCredentials::getMiddleware ('a scope ' );
284284 }
285285
286286 public function testGetMiddlewareLoadsOKIfEnvSpecifiedIsValid ()
287287 {
288- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
288+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
289289 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
290290 $ this ->assertNotNull (ApplicationDefaultCredentials::getMiddleware ('a scope ' ));
291291 }
292292
293293 public function testLGetMiddlewareoadsDefaultFileIfPresentAndEnvVarIsNotSet ()
294294 {
295- setHomeEnv (__DIR__ . '/fixtures ' );
295+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
296296 $ this ->assertNotNull (ApplicationDefaultCredentials::getMiddleware ('a scope ' ));
297297 }
298298
@@ -314,7 +314,7 @@ public function testGetMiddlewareFailsIfNotOnGceAndNoDefaultFileFound()
314314
315315 public function testGetMiddlewareWithCacheOptions ()
316316 {
317- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
317+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
318318 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
319319
320320 $ httpHandler = getHandler ([
@@ -457,14 +457,14 @@ public function testGetIdTokenCredentialsFailsIfEnvSpecifiesNonExistentFile()
457457 {
458458 $ this ->expectException (DomainException::class);
459459
460- $ keyFile = __DIR__ . '/fixtures ' . ' /does-not-exist-private.json ' ;
460+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /does-not-exist-private.json ' ;
461461 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
462462 ApplicationDefaultCredentials::getIdTokenCredentials ($ this ->targetAudience );
463463 }
464464
465465 public function testGetIdTokenCredentialsLoadsOKIfEnvSpecifiedIsValid ()
466466 {
467- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
467+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
468468 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
469469
470470 $ creds = ApplicationDefaultCredentials::getIdTokenCredentials ($ this ->targetAudience );
@@ -473,7 +473,7 @@ public function testGetIdTokenCredentialsLoadsOKIfEnvSpecifiedIsValid()
473473
474474 public function testGetIdTokenCredentialsLoadsDefaultFileIfPresentAndEnvVarIsNotSet ()
475475 {
476- setHomeEnv (__DIR__ . '/fixtures ' );
476+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
477477 $ creds = ApplicationDefaultCredentials::getIdTokenCredentials ($ this ->targetAudience );
478478 $ this ->assertInstanceOf (ServiceAccountCredentials::class, $ creds );
479479 }
@@ -500,14 +500,14 @@ public function testGetIdTokenCredentialsFailsIfNotOnGceAndNoDefaultFileFound()
500500
501501 public function testGetIdTokenCredentialsWithImpersonatedServiceAccountCredentials ()
502502 {
503- setHomeEnv (__DIR__ . '/fixtures5 ' );
503+ setHomeEnv (__DIR__ . '/fixtures/ fixtures5 ' );
504504 $ creds = ApplicationDefaultCredentials::getIdTokenCredentials ('123@456.com ' );
505505 $ this ->assertInstanceOf (ImpersonatedServiceAccountCredentials::class, $ creds );
506506 }
507507
508508 public function testGetIdTokenCredentialsWithCacheOptions ()
509509 {
510- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
510+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
511511 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
512512
513513 $ httpHandler = getHandler ([
@@ -553,7 +553,7 @@ public function testGetIdTokenCredentialsSuccedsIfNoDefaultFilesButIsOnGCE()
553553
554554 public function testGetIdTokenCredentialsWithUserRefreshCredentials ()
555555 {
556- setHomeEnv (__DIR__ . '/fixtures2 ' );
556+ setHomeEnv (__DIR__ . '/fixtures/ fixtures2 ' );
557557
558558 $ creds = ApplicationDefaultCredentials::getIdTokenCredentials (
559559 $ this ->targetAudience ,
@@ -572,7 +572,7 @@ public function testGetIdTokenCredentialsWithUserRefreshCredentials()
572572
573573 public function testWithServiceAccountCredentialsAndExplicitQuotaProject ()
574574 {
575- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
575+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
576576 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
577577
578578 $ credentials = ApplicationDefaultCredentials::getCredentials (
@@ -593,7 +593,7 @@ public function testWithServiceAccountCredentialsAndExplicitQuotaProject()
593593
594594 public function testGetCredentialsUtilizesQuotaProjectInKeyFile ()
595595 {
596- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
596+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
597597 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
598598
599599 $ credentials = ApplicationDefaultCredentials::getCredentials ();
@@ -609,7 +609,7 @@ public function testGetCredentialsUtilizesQuotaProjectEnvVar()
609609 {
610610 $ quotaProject = 'quota-project-from-env-var ' ;
611611 putenv (CredentialsLoader::QUOTA_PROJECT_ENV_VAR . '= ' . $ quotaProject );
612- setHomeEnv (__DIR__ . '/fixtures ' );
612+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
613613
614614 $ credentials = ApplicationDefaultCredentials::getCredentials ();
615615
@@ -624,7 +624,7 @@ public function testGetCredentialsUtilizesQuotaProjectParameterOverEnvVar()
624624 {
625625 $ quotaProject = 'quota-project-from-parameter ' ;
626626 putenv (CredentialsLoader::QUOTA_PROJECT_ENV_VAR . '=quota-project-from-env-var ' );
627- setHomeEnv (__DIR__ . '/fixtures ' );
627+ setHomeEnv (__DIR__ . '/fixtures/fixtures1 ' );
628628
629629 $ credentials = ApplicationDefaultCredentials::getCredentials (
630630 null , // $scope
@@ -645,7 +645,7 @@ public function testGetCredentialsUtilizesQuotaProjectParameterOverEnvVar()
645645 public function testGetCredentialsUtilizesQuotaProjectEnvVarOverKeyFile ()
646646 {
647647 $ quotaProject = 'quota-project-from-env-var ' ;
648- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
648+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
649649 putenv (CredentialsLoader::QUOTA_PROJECT_ENV_VAR . '= ' . $ quotaProject );
650650 putenv (CredentialsLoader::ENV_VAR . '= ' . $ keyFile );
651651
@@ -659,7 +659,7 @@ public function testGetCredentialsUtilizesQuotaProjectEnvVarOverKeyFile()
659659
660660 public function testWithFetchAuthTokenCacheAndExplicitQuotaProject ()
661661 {
662- $ keyFile = __DIR__ . '/fixtures ' . ' /private.json ' ;
662+ $ keyFile = __DIR__ . '/fixtures/fixtures1 /private.json ' ;
663663 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
664664
665665 $ httpHandler = getHandler ([
@@ -761,7 +761,7 @@ public function testAppEngineFlexibleIdToken()
761761 */
762762 public function testExternalAccountCredentials (string $ jsonFile , string $ expectedCredSource )
763763 {
764- putenv (sprintf ('GOOGLE_APPLICATION_CREDENTIALS=%s/fixtures6/%s ' , __DIR__ , $ jsonFile ));
764+ putenv (sprintf ('GOOGLE_APPLICATION_CREDENTIALS=%s/fixtures/ fixtures6/%s ' , __DIR__ , $ jsonFile ));
765765
766766 $ creds = ApplicationDefaultCredentials::getCredentials ('a_scope ' );
767767
@@ -832,19 +832,19 @@ public function provideExternalAccountCredentials()
832832 public function testUniverseDomainInKeyFile ()
833833 {
834834 // Test no universe domain in keyfile defaults to "googleapis.com"
835- $ keyFile = __DIR__ . '/fixtures3/service_account_credentials.json ' ;
835+ $ keyFile = __DIR__ . '/fixtures/ fixtures3/service_account_credentials.json ' ;
836836 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
837837 $ creds = ApplicationDefaultCredentials::getCredentials ();
838838 $ this ->assertEquals (CredentialsLoader::DEFAULT_UNIVERSE_DOMAIN , $ creds ->getUniverseDomain ());
839839
840840 // Test universe domain in "service_account" keyfile
841- $ keyFile = __DIR__ . '/fixtures/private.json ' ;
841+ $ keyFile = __DIR__ . '/fixtures/fixtures1/ private.json ' ;
842842 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
843843 $ creds = ApplicationDefaultCredentials::getCredentials ();
844844 $ this ->assertEquals ('example-universe.com ' , $ creds ->getUniverseDomain ());
845845
846846 // Test universe domain in "authenticated_user" keyfile is not read.
847- $ keyFile = __DIR__ . '/fixtures2/private.json ' ;
847+ $ keyFile = __DIR__ . '/fixtures/ fixtures2/private.json ' ;
848848 putenv (ServiceAccountCredentials::ENV_VAR . '= ' . $ keyFile );
849849 $ creds2 = ApplicationDefaultCredentials::getCredentials ();
850850 $ this ->assertEquals (CredentialsLoader::DEFAULT_UNIVERSE_DOMAIN , $ creds2 ->getUniverseDomain ());
0 commit comments