Skip to content
Prev Previous commit
Next Next commit
Fixing test, ECS environment variable only for ECS
  • Loading branch information
cuppett committed Dec 16, 2020
commit 67cc9c670aed0e7da5576c26b9b1692e687e7c8f
8 changes: 4 additions & 4 deletions tests/Credentials/CredentialProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1797,19 +1797,19 @@ public function testCallsDefaultsCreds()

public function testCachesCacheableInDefaultChain()
{
$this->clearEnv();
putenv('AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/latest');
$cacheable = [
'web_identity',
'ecs',
'sso',
'process_credentials',
'process_config',
'sso',
'ecs',
'instance'
];

$credsForCache = new Credentials('foo', 'bar', 'baz', PHP_INT_MAX);
foreach ($cacheable as $provider) {
$this->clearEnv();
if ($provider == 'ecs') putenv('AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/latest');
$cache = new LruArrayCache;
$cache->set('aws_cached_' . $provider . '_credentials', $credsForCache);
$credentials = call_user_func(CredentialProvider::defaultProvider([
Expand Down