public function read($key)
{
$this->ensureBucketExists();
$options = $this->getOptions($key);
try {
return (string) $this->service->getObject($options)->get('Body');
} catch (\Exception $e) {
return false;
}
}
/** * @expectedException \RuntimeException */ public function testThrowsExceptionIfBucketMissingAndNotCreating() { $mock = new MockPlugin(array(new Response(404))); $client = $this->getClient(); $client->addSubscriber($mock); $adapter = new AwsS3($client, 'bucket'); $adapter->read('foo'); }