/**
  * Test removing file from storage backend.
  */
 public function testRemoveFile()
 {
     $container = static::$kernel->getContainer();
     $fileStorageConfiguration = $container->get('reskume_file.configuration.file_storage_configuration');
     $fileStorage = $fileStorageConfiguration->createFileStorage($this->em);
     // clean and copy files for testing purposes
     $filesystem = new Filesystem();
     $this->cleanDir(TestPathProvider::getPath() . '/App/tmp');
     // clean 'tmp' dir
     $filesystem->copy(TestPathProvider::getPath() . '/Fixtures/files/test_image.jpeg', TestPathProvider::getPath() . '/App/tmp/uploadFiles/test_image_1.jpeg');
     $file = new File();
     $file->setOrigFilename('test_image_1.jpeg')->setPath('test/images')->setTmpPathname(TestPathProvider::getPath() . '/App/tmp/uploadFiles/test_image_1.jpeg')->createKey()->setFileMetadata();
     $this->em->persist($file);
     $this->em->flush();
     // file storage persist is automatically called
     $this->em->clear();
     // get file via storage backend
     $file = $fileStorage->getFile($file->getKey());
     $this->em->remove($file);
     $this->em->flush();
     $this->expectException('League\\Flysystem\\FileNotFoundException');
     $fileStorage->getContent($file);
 }