@@ -598,19 +598,22 @@ public function testExecutableCredentialSourceEnvironmentVars()
598598 'expiration_time ' => time () + 100 ,
599599 ]);
600600
601- if (PHP_OS_FAMILY === 'Windows ' ) {
602- $ successJson = str_replace ('" ' , '\" ' , $ successJson );
603- }
601+ $ successJson = PHP_OS_FAMILY === 'Windows '
602+ ? str_replace ('" ' , '\" ' , $ successJson )
603+ : $ successJson ;
604+
604605 $ command = sprintf (
605- 'echo YAY > %s ' .
606+ 'echo $GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE,$GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE,%s > %s ' .
606607 ' && echo \'%s \' > $GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE ' .
607608 ' && echo \'%s \'' ,
608- // escapeshellarg($fileContents),
609+ escapeshellarg ($ fileContents ),
609610 escapeshellarg ($ tmpFile ),
610611 $ successJson ,
611612 $ successJson
612613 );
613614
615+ var_dump ($ command );exit ;
616+
614617 if (PHP_OS_FAMILY === 'Windows ' ) {
615618 // On Windows, wrap the command in DOUBLE quotes and ensure the inner single quotes are safe.
616619 // We escape the double quotes and dollar signs that Bash needs to see literally.
@@ -652,8 +655,7 @@ public function testExecutableCredentialSourceEnvironmentVars()
652655
653656 $ this ->assertFileExists ($ tmpFile );
654657 $ this ->assertEquals (
655- // 'test-audience,test-token-type,' . $fileContents . PHP_EOL,
656- 'YAY ' . PHP_EOL ,
658+ 'test-audience,test-token-type, ' . $ fileContents . PHP_EOL ,
657659 file_get_contents ($ tmpFile )
658660 );
659661 }
0 commit comments