/** * @param \Gaufrette\Adapter\OpenStackCloudFiles\ObjectStoreFactoryInterface $objectStoreFactory * @param \OpenCloud\ObjectStore\Service $objectStore * @param \OpenCloud\ObjectStore\Resource\Container $container */ function it_initializes_object_store($objectStoreFactory, $objectStore, $container) { $objectStoreFactory->getObjectStore()->shouldBeCalled()->willReturn($objectStore); $objectStore->getContainer("test-container-name")->shouldBeCalled()->willReturn($container); $container->getObject("test-file-name")->willThrow(new ObjectNotFoundException()); $this->exists("test-file-name"); }
/** * Override parent to lazy-load object store. * * {@inheritdoc} */ protected function getContainer() { if (!$this->objectStore) { $this->objectStore = $this->objectStoreFactory->getObjectStore(); } return parent::getContainer(); }