示例#1
0
 /**
  * Constructor
  * 
  * @param FileItem $fileItem
  * @param Yosymfony\Spress\Configuration $configuration
  */
 public function __construct(FileItem $fileItem, $configuration)
 {
     if ($fileItem->getType() !== FileItem::TYPE_PAGE) {
         throw new \InvalidArgumentException(sprintf('Type item "%s" is invalid in page item.', $fileItem->getType()));
     }
     parent::__construct($fileItem, $configuration);
     $this->setUpDestinationPath();
 }
示例#2
0
 /**
  * Constructor
  * 
  * @param FileItem $fileItem
  * @param Yosymfony\Spress\Configuration $configuration
  */
 public function __construct(FileItem $fileItem, $configuration)
 {
     if ($fileItem->getType() !== FileItem::TYPE_POST) {
         throw new \InvalidArgumentException(sprintf('Type item "%s" is invalid in post item'));
     }
     parent::__construct($fileItem, $configuration);
     $this->extractDataFromFilename();
     $this->setUpDestinationPath();
 }
示例#3
0
 public function testType()
 {
     $fileItem = new FileItem($this->mock, FileItem::TYPE_POST);
     $this->assertEquals(FileItem::TYPE_POST, $fileItem->getType());
 }