public function testGetPageList()
 {
     $tree = ['id' => 1, 'parent' => '#', 'text' => 'Root Page', 'state' => ['opened' => true]];
     $this->pageTreeHandler->expects($this->once())->method('createTree')->will($this->returnValue($tree));
     $result = $this->extension->getPageList();
     $this->assertEquals($tree, $result);
 }
 /**
  * @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);
 }
示例#3
0
 /**
  * @return array
  */
 public function getPageList()
 {
     return $this->pageTreeHandler->createTree();
 }