public function testCreate() { $this->adapterFactory->expects($this->once())->method('create')->willReturn(new \Gaufrette\Adapter\Local(sys_get_temp_dir())); $definition = new Definition(); $filesystem = $this->subject->create($definition); $this->assertInstanceOf('Abc\\Filesystem\\Filesystem', $filesystem); }
/** * {@inheritdoc} */ public function destroy() { $this->remove('/'); $path = basename($this->definition->getPath()); $properties = $this->definition->getProperties() == null ? array() : $this->definition->getProperties(); $adapter = $this->adapterFactory->create($this->definition->getType(), dirname($this->definition->getPath()), $properties); $adapter->delete($path); if ($adapter->exists($path)) { throw new \RuntimeException('Failed to destroy filesystem'); } }