示例#1
0
 /**
  * @dataProvider getClearedPaths
  *
  * @param string $path
  * @param string $storage_path
  * @param string $cleared_path
  */
 public function testDoClearPath($path, $storage_path, $cleared_path)
 {
     if ($storage_path) {
         $storage = $this->getMock('\\AnimeDb\\Bundle\\CatalogBundle\\Entity\\Storage');
         $storage->expects($this->atLeastOnce())->method('getPath')->will($this->returnValue($storage_path));
         $this->item->setStorage($storage);
     }
     $this->item->setPath($path);
     $this->assertEquals($cleared_path, $this->item->getRealPath());
     $this->assertEquals($path, $this->item->getPath());
 }
 /**
  * Get info filename
  *
  * @param \AnimeDb\Bundle\CatalogBundle\Entity\Item $item
  *
  * @return string
  */
 protected function getInfo(ItemEntity $item)
 {
     $filename = self::INFO_FILENAME . '.html';
     if (is_file($item->getPath())) {
         return dirname($item->getPath()) . pathinfo($item->getPath(), PATHINFO_FILENAME) . '-' . $filename;
     } else {
         return $item->getPath() . '/' . $filename;
     }
 }