/** * @dataProvider pageTreeCollectionRepository */ public function testPageTreeCollection($languages, $pages, $templates, $expectedlanguages, $expectedPages) { $this->configureLanguagesRepository($languages); $this->configurePagesRepository($pages); $this->configureBlocksRepository(); $this->configureSeoRepository($languages, $pages); $this->configureTheme($templates); $pageTreeCollection = new PageTreeCollection($this->assetsManager, $this->activeTheme, $this->templateManager, $this->pageBlocks, $this->factoryRepository); $pageTreeCollection->fill(); $this->assertCount($expectedlanguages, $pageTreeCollection->getPages()); $this->assertCount($expectedPages, $pageTreeCollection->getBasePages()); }
/** * Saves the pages instantiating an PageTreeCollection object * * @param \RedKiteLabs\ThemeEngineBundle\Core\Theme\Theme $theme * @param array $options An array of options * @return boolean */ protected function savePages(Theme $theme, array $options) { $pages = $this->pageTreeCollection->getPages(); $basePages = $this->pageTreeCollection->getBasePages(); $options["type"] = "Pages"; if (!$this->doSavePages($pages, $theme, $options)) { return false; } $options["type"] = "Base"; if (!$this->doSavePages($basePages, $theme, $options)) { return false; } return true; }