/** * {@inheritdoc} */ public function remove(File $file) : bool { $key = $file->getKey(); if ($this->filesystem->has($key)) { return $this->filesystem->delete($key); } return true; }
/** * Test that key string is created. */ public function testCreateKey() { $file = new File(); $file->setTmpPathname(TestPathProvider::getPath() . '/Fixtures/files/test.txt')->setFileMetadata()->setPath('/test/path')->createKey(); $this->assertEquals(1, preg_match('/^(\\/\\w+)+\\.[a-zA-Z]+$/', $file->getKey())); }