コード例 #1
0
 /**
  * @dataProvider blockManagersProvider
  */
 public function testGetBlockManagers($slotName, $slotManager, $expectedResult)
 {
     if (null !== $slotManager) {
         $this->templateManager->expects($this->once())->method('getSlotManager')->with($slotName)->will($this->returnValue($slotManager));
         $bmCollection = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Slot\\Blocks\\BlockManagersCollection')->disableOriginalConstructor()->getMock();
         $bmCollection->expects($this->once())->method('getBlockManagers')->will($this->returnValue($expectedResult));
         $slotManager->expects($this->once())->method('getBlockManagersCollection')->will($this->returnValue($bmCollection));
     }
     $pageTree = new PageTree($this->templateAssetsManager);
     $pageTree->setUp($this->theme, $this->templateManager, $this->pageBlocks);
     $this->assertEquals($expectedResult, $pageTree->getBlockManagers($slotName));
 }