CodeExplorer NavigationLoader example
protected function setUp(): void
{ $this->repository =
$this->
getContainer()->
get('category.repository'
);
$this->ids =
new IdsCollection();
$this->navigationLoader =
$this->
getContainer()->
get(NavigationLoader::
class);
} public function testTreeBuilderWithSimpleTree(): void
{ $loader =
new NavigationLoader( $this->
createMock(EventDispatcher::
class),
$this->
createMock(NavigationRoute::
class) );
$categories =
$this->
createSimpleTree();
/** @var Tree $tree */
$tree = ReflectionHelper::
getMethod(NavigationLoader::
class, 'getTree'
)->
invoke($loader, '1',
new CategoryCollection($categories), \
array_shift($categories));
$treeItems =
$tree->
getTree();