/** * @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; }
protected function createAlbums(Tx_Yag_Domain_Model_Gallery $gallery) { $albumRepository = $this->objectManager->get('Tx_Yag_Domain_Repository_AlbumRepository'); /* @var $albumRepository Tx_Yag_Domain_Repository_AlbumRepository */ $first = true; for ($i = 1; $i <= $this->albumsPerGalleryCount; $i++) { $album = new Tx_Yag_Domain_Model_Album(); $album->setName('TestAlbum ' . $i); $album->setDescription('Created on ' . date('d.m.Y H:i:s')); $album->setGallery($gallery); $albumRepository->add($album); if ($first) { $gallery->setThumbAlbum($album); $first = FALSE; } $this->createItems($album); } }