Mise à jour des librairies vendor
This commit is contained in:
@@ -21,8 +21,9 @@ use Google\Auth\ApplicationDefaultCredentials;
|
||||
use Google\Auth\Credentials\GCECredentials;
|
||||
use Google\Auth\Credentials\ServiceAccountCredentials;
|
||||
use GuzzleHttp\Psr7;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ADCGetTest extends \PHPUnit_Framework_TestCase
|
||||
class ADCGetTest extends TestCase
|
||||
{
|
||||
private $originalHome;
|
||||
|
||||
@@ -101,7 +102,7 @@ class ADCGetTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
class ADCGetMiddlewareTest extends \PHPUnit_Framework_TestCase
|
||||
class ADCGetMiddlewareTest extends TestCase
|
||||
{
|
||||
private $originalHome;
|
||||
|
||||
@@ -156,6 +157,26 @@ class ADCGetMiddlewareTest extends \PHPUnit_Framework_TestCase
|
||||
ApplicationDefaultCredentials::getMiddleware('a scope', $httpHandler);
|
||||
}
|
||||
|
||||
public function testWithCacheOptions()
|
||||
{
|
||||
$keyFile = __DIR__ . '/fixtures' . '/private.json';
|
||||
putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile);
|
||||
|
||||
$httpHandler = getHandler([
|
||||
buildResponse(200),
|
||||
]);
|
||||
|
||||
$cacheOptions = [];
|
||||
$cachePool = $this->getMock('Psr\Cache\CacheItemPoolInterface');
|
||||
|
||||
$middleware = ApplicationDefaultCredentials::getMiddleware(
|
||||
'a scope',
|
||||
$httpHandler,
|
||||
$cacheOptions,
|
||||
$cachePool
|
||||
);
|
||||
}
|
||||
|
||||
public function testSuccedsIfNoDefaultFilesButIsOnGCE()
|
||||
{
|
||||
$wantedTokens = [
|
||||
@@ -196,6 +217,7 @@ class ADCGetCredentialsAppEngineTest extends BaseTest
|
||||
// removes it if assigned
|
||||
putenv('HOME=' . $this->originalHome);
|
||||
putenv(ServiceAccountCredentials::ENV_VAR . '=' . $this->originalServiceAccount);
|
||||
putenv('GAE_INSTANCE');
|
||||
}
|
||||
|
||||
public function testAppEngineStandard()
|
||||
@@ -210,7 +232,7 @@ class ADCGetCredentialsAppEngineTest extends BaseTest
|
||||
public function testAppEngineFlexible()
|
||||
{
|
||||
$_SERVER['SERVER_SOFTWARE'] = 'Google App Engine';
|
||||
$_SERVER['GAE_VM'] = 'true';
|
||||
putenv('GAE_INSTANCE=aef-default-20180313t154438');
|
||||
$httpHandler = getHandler([
|
||||
buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']),
|
||||
]);
|
||||
@@ -279,6 +301,26 @@ class ADCGetSubscriberTest extends BaseTest
|
||||
ApplicationDefaultCredentials::getSubscriber('a scope', $httpHandler);
|
||||
}
|
||||
|
||||
public function testWithCacheOptions()
|
||||
{
|
||||
$keyFile = __DIR__ . '/fixtures' . '/private.json';
|
||||
putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile);
|
||||
|
||||
$httpHandler = getHandler([
|
||||
buildResponse(200),
|
||||
]);
|
||||
|
||||
$cacheOptions = [];
|
||||
$cachePool = $this->getMock('Psr\Cache\CacheItemPoolInterface');
|
||||
|
||||
$subscriber = ApplicationDefaultCredentials::getSubscriber(
|
||||
'a scope',
|
||||
$httpHandler,
|
||||
$cacheOptions,
|
||||
$cachePool
|
||||
);
|
||||
}
|
||||
|
||||
public function testSuccedsIfNoDefaultFilesButIsOnGCE()
|
||||
{
|
||||
$wantedTokens = [
|
||||
|
||||
Reference in New Issue
Block a user