/** * @param \Gaufrette\Adapter $adapter * @param \AmazonS3 $service */ function it_does_not_write_when_cannot_update_acl($adapter, $service) { $service->set_object_acl('bucketName', 'filename', \AmazonS3::ACL_PRIVATE)->shouldBeCalled()->willReturn(new \CFResponse(array(), '', 500)); $adapter->write('filename', 'some content')->shouldBeCalled()->willReturn(12); $adapter->delete('filename')->shouldBeCalled(); $this->write('filename', 'some content')->shouldReturn(false); }
/** * {@inheritdoc} */ public function delete($key) { $ok = true; try { $this->slave->delete($key); } catch (\Exception $e) { if ($this->logger) { $this->logger->critical(sprintf('Unable to delete %s, error: %s', $key, $e->getMessage())); } $ok = false; } try { $this->master->delete($key); } catch (\Exception $e) { if ($this->logger) { $this->logger->critical(sprintf('Unable to delete %s, error: %s', $key, $e->getMessage())); } $ok = false; } return $ok; }
/** * @param $key * @return mixed */ public function delete($key) { return $this->gaufretteAdapter->delete($key); }
/** * @param \Gaufrette\Adapter $adapter */ function it_fails_when_delete_is_not_successful($adapter) { $adapter->exists('filename')->willReturn(true); $adapter->delete('filename')->willReturn(false); $this->shouldThrow(new \RuntimeException('Could not remove the "filename" key.'))->duringDelete('filename'); }
/** * {@inheritdoc} */ public function delete($key) { return $this->source->delete($key) && $this->cache->delete($key); }
/** * @param \Gaufrette\Adapter $source * @param \Gaufrette\Adapter $cache */ function it_should_delete_file_from_source_and_cache($source, $cache) { $source->delete('filename')->shouldBeCalled()->willReturn(true); $cache->delete('filename')->shouldBeCalled()->willReturn(true); $this->delete('filename')->shouldReturn(true); }
/** * {@InheritDoc} */ public function delete($key) { $this->source->delete($key); $this->cache->delete($key); }
/** * {@inheritDoc} */ public function delete($key) { return $this->primary->delete($key); }