/**
  * @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());
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function deploy(PageTreeCollection $pageTreeCollection, ActiveThemeInterface $activeTheme, array $options)
 {
     $this->dispatch(Deploy\DeployEvents::BEFORE_DEPLOY, new Deploy\BeforeDeployEvent($this));
     $theme = $activeTheme->getActiveThemeBackend();
     $this->pageTreeCollection = $pageTreeCollection;
     $deployFolder = $options["deployDir"];
     $this->fileSystem->remove($deployFolder);
     $this->checkTargetFolders($options);
     $this->pageTreeCollection->fill();
     if (!$this->savePages($theme, $options)) {
         return false;
     }
     $this->copyAssets($options);
     $this->routingGenerator->generateRouting($options["deployBundle"], $options["deployController"])->writeRouting($options["configDir"]);
     if (null !== $this->sitemapGenerator) {
         $this->sitemapGenerator->writeSiteMap($options["webFolderPath"], $options["websiteUrl"]);
     }
     $this->updateActiveThemeReference($activeTheme, $options);
     $this->dispatch(Deploy\DeployEvents::AFTER_DEPLOY, new Deploy\AfterDeployEvent($this));
     return true;
 }