public function testSetDestinationPaths() { $fileItem = new FileItem($this->mock, FileItem::TYPE_POST); $fileItem->setDestinationPaths(array('/spress_test/_site/2013/08/22/example.html')); $this->assertTrue(is_array($fileItem->getDestinationPaths())); $this->assertCount(1, $fileItem->getDestinationPaths()); }
/** * Save a FileItem into destiny paths * * @param FileItem $item */ public function saveItem(FileItem $item) { $fs = new Filesystem(); $paths = $item->getDestinationPaths(); if (0 == count($paths)) { throw new \LengthException('No destination paths found'); } foreach ($paths as $destination) { $fs->dumpFile($this->getDestinationDir() . '/' . $destination, $item->getDestinationContent()); } }