public function testCredentialsCanInjectCacheAndUsesHostnameBasedKey()
 {
     $cache = new DoctrineCacheAdapter(new ArrayCache());
     $cache->save('credentials_' . crc32(gethostname()), new Credentials('ABC', '123', 'Listen to me', time() + 10000));
     $credentials = Credentials::factory(array('credentials.cache' => $cache));
     $this->assertInstanceOf('Aws\\Common\\Credentials\\CacheableCredentials', $credentials);
     $this->assertSame($cache, $this->readAttribute($credentials, 'cache'));
     $this->assertEquals('ABC', $credentials->getAccessKeyId());
 }
Example #2
0
 public function testDelete()
 {
     $this->assertTrue($this->adapter->save('test', 'data', 1000));
     $this->assertTrue($this->adapter->delete('test'));
     $this->assertFalse($this->adapter->contains('test'));
 }