Skip to content

Commit 61d81a8

Browse files
andimovslopukhov
authored andcommitted
MAGETWO-95651: Narrow number of top menu cache versions
1 parent 77af5d6 commit 61d81a8

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

app/code/Magento/Theme/Block/Html/Topmenu.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,7 @@ public function getIdentities()
369369
*/
370370
public function getCacheKeyInfo()
371371
{
372-
$keyInfo = parent::getCacheKeyInfo();
373-
$keyInfo[] = $this->getUrl('*/*/*', ['_current' => true, '_query' => '']);
374-
return $keyInfo;
372+
return parent::getCacheKeyInfo();
375373
}
376374

377375
/**

app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ public function testGetCacheKeyInfo()
189189
$treeFactory = $this->createMock(\Magento\Framework\Data\TreeFactory::class);
190190

191191
$topmenu = new Topmenu($this->context, $nodeFactory, $treeFactory);
192-
$this->urlBuilder->expects($this->once())->method('getUrl')->with('*/*/*')->willReturn('123');
193192
$this->urlBuilder->expects($this->once())->method('getBaseUrl')->willReturn('baseUrl');
194193
$store = $this->getMockBuilder(\Magento\Store\Model\Store::class)
195194
->disableOriginalConstructor()
@@ -199,7 +198,7 @@ public function testGetCacheKeyInfo()
199198
$this->storeManager->expects($this->once())->method('getStore')->willReturn($store);
200199

201200
$this->assertEquals(
202-
['BLOCK_TPL', '321', null, 'base_url' => 'baseUrl', 'template' => null, '123'],
201+
['BLOCK_TPL', '321', null, 'base_url' => 'baseUrl', 'template' => null],
203202
$topmenu->getCacheKeyInfo()
204203
);
205204
}

0 commit comments

Comments
 (0)