public function testNavigationStateTestParent() { $this->data['products'] = $this->mapper->save(['title' => 'Products', 'url' => '/products'], 'simple', 'sulu_io', 'en', 1, true, $this->data['products']->getUuid(), null, StructureInterface::STATE_TEST); $navigation = $this->navigation->getRootNavigation('sulu_io', 'en', 2); $this->assertCount(1, $navigation); $this->assertEquals('/news', $navigation[0]['url']); $this->assertCount(2, $navigation[0]['children']); $this->assertEquals('/news/news-1', $navigation[0]['children'][0]['url']); $this->assertEquals('/news/news-2', $navigation[0]['children'][1]['url']); }
/** * {@inheritdoc} */ public function treeRootNavigationFunction($context = null, $depth = 1, $loadExcerpt = false) { $webspaceKey = $this->requestAnalyzer->getWebspace()->getKey(); $locale = $this->requestAnalyzer->getCurrentLocalization()->getLocalization(); return $this->navigationMapper->getRootNavigation($webspaceKey, $locale, $depth, false, $context, $loadExcerpt); }