/**
  * @covers Alchemy\Zippy\Resource\ResourceCollection::isTemporary
  * @covers Alchemy\Zippy\Resource\ResourceCollection::setTemporary
  */
 public function testSetIsTemporary()
 {
     $collection = new ResourceCollection('supa-context');
     $this->assertFalse($collection->isTemporary());
     $collection->setTemporary(true);
     $this->assertTrue($collection->isTemporary());
     $collection->setTemporary(false);
     $this->assertFalse($collection->isTemporary());
 }
 /**
  * This method must be called once the ResourceCollection has been processed.
  *
  * It will remove temporary files
  *
  * @todo this should be done in the __destruct method of ResourceCollection
  *
  * @param ResourceCollection $collection
  */
 public function cleanup(ResourceCollection $collection)
 {
     if ($collection->isTemporary()) {
         try {
             $this->filesystem->remove($collection->getContext());
         } catch (IOException $e) {
             // log this ?
         }
     }
 }