Esempio n. 1
0
 public function testGetCacheKeyInfo()
 {
     $nodeFactory = $this->getMock('Magento\\Framework\\Data\\Tree\\NodeFactory', [], [], '', false);
     $treeFactory = $this->getMock('Magento\\Framework\\Data\\TreeFactory', [], [], '', false);
     $topmenu = new Topmenu($this->context, $nodeFactory, $treeFactory);
     $this->urlBuilder->expects($this->once())->method('getUrl')->with('*/*/*')->willReturn('123');
     $store = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->setMethods(['getCode'])->getMock();
     $store->expects($this->once())->method('getCode')->willReturn('321');
     $this->storeManager->expects($this->once())->method('getStore')->willReturn($store);
     $this->assertEquals(['BLOCK_TPL', '321', null, 'template' => null, '123'], $topmenu->getCacheKeyInfo());
 }