Beispiel #1
0
 /**
  * @param NodeInterface $node
  *
  * @return LocalFile
  * @throws InvalidCompressionTypeException
  */
 public function flow(NodeInterface $node)
 {
     if (!$node instanceof LocalFile) {
         throw new InvalidArgumentException("Node: {$node} should be an instance of LocalFile");
     }
     $factory = new CompressionFactory();
     $compressor = $factory->getDeCompressor($node->getCompression());
     $this->log(LogLevel::INFO, "DeCompressing file: '{file}'", ['file' => $node]);
     return $compressor->decompress($node, $this->options);
 }
 public function testGetDeCompressorForRandomWillThrowAnException()
 {
     $this->expectException(InvalidCompressionTypeException::class);
     $this->factory->getDeCompressor('random');
 }