Exemplo n.º 1
0
 /**
  * @return Tx_Yag_Domain_Model_Item
  */
 protected function getTestItemObject()
 {
     $item = new Tx_Yag_Domain_Model_Item();
     $album = new Tx_Yag_Domain_Model_Album();
     $gallery = new Tx_Yag_Domain_Model_Gallery();
     $album->setGallery($gallery);
     $item->setAlbum($album);
     $item->setSourceuri(substr(ExtensionManagementUtility::extPath($this->extensionName) . 'Tests/Unit/TestImages/', strlen(PATH_site)) . 'testImage.jpg');
     return $item;
 }
Exemplo n.º 2
0
 protected function createItems(Tx_Yag_Domain_Model_Album $album)
 {
     $itemRepository = $this->objectManager->get('Tx_Yag_Domain_Repository_ItemRepository');
     /* @var $itemRepository Tx_Yag_Domain_Repository_ItemRepository */
     $first = true;
     for ($i = 1; $i <= $this->itemsPerGalleryCount; $i++) {
         $item = new Tx_Yag_Domain_Model_Item();
         $item->setTitle('TestItem ' . $i);
         $item->setAlbum($album);
         $item->setSourceuri(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('yag') . 'Tests/Unit/TestImages/testImage.jpg');
         if ($first) {
             $album->setThumb($item);
             $first = FALSE;
         }
         $itemRepository->add($item);
     }
 }