/**
  * @dataProvider createTreeDataProvider
  * @param Page[] $pages
  * @param array $expected
  */
 public function testCreateTree($pages, array $expected)
 {
     $this->managerRegistry->expects($this->any())->method('getRepository')->with('OroB2BCMSBundle:Page')->willReturn($this->repository);
     $this->repository->expects($this->any())->method('getChildren')->with(null, false, 'left', 'ASC')->willReturn($pages);
     $result = $this->pageTreeHandler->createTree();
     $this->assertEquals($expected, $result);
 }
Example #2
0
 /**
  * @return array
  */
 public function getPageList()
 {
     return $this->pageTreeHandler->createTree();
 }