Skip to content
Snippets Groups Projects
Commit d81b658b authored by Mykola Palamar's avatar Mykola Palamar
Browse files

Merge remote-tracking branch 'east/MAGETWO-55055' into EAST-CADENCE-1-CE

parents 2662f8a7 6ab22bc7
Branches
No related merge requests found
......@@ -118,4 +118,16 @@ class FinalPriceBox extends BasePriceBox
&& $minimalPriceAValue
&& $minimalPriceAValue < $finalPriceValue;
}
/**
* {@inheritdoc}
*
* @return array
*/
public function getCacheKeyInfo()
{
$cacheKeys = parent::getCacheKeyInfo();
$cacheKeys['display_minimal_price'] = $this->getDisplayMinimalPrice();
return $cacheKeys;
}
}
......@@ -84,6 +84,22 @@ class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase
$cacheState = $this->getMockBuilder(\Magento\Framework\App\Cache\StateInterface::class)
->getMockForAbstractClass();
$storeManager = $this->getMockBuilder('\Magento\Store\Model\StoreManagerInterface')
->setMethods(['getStore', 'getCode'])
->getMockForAbstractClass();
$storeManager->expects($this->any())->method('getStore')->willReturnSelf();
$appState = $this->getMockBuilder('\Magento\Framework\App\State')
->disableOriginalConstructor()
->getMock();
$resolver = $this->getMockBuilder('\Magento\Framework\View\Element\Template\File\Resolver')
->disableOriginalConstructor()
->getMock();
$urlBuilder = $this->getMockBuilder('\Magento\Framework\UrlInterface')
->getMockForAbstractClass();
$scopeConfigMock = $this->getMockForAbstractClass('Magento\Framework\App\Config\ScopeConfigInterface');
$context = $this->getMock('Magento\Framework\View\Element\Template\Context', [], [], '', false);
$context->expects($this->any())
......@@ -104,6 +120,18 @@ class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase
$context->expects($this->any())
->method('getCacheState')
->will($this->returnValue($cacheState));
$context->expects($this->any())
->method('getStoreManager')
->will($this->returnValue($storeManager));
$context->expects($this->any())
->method('getAppState')
->will($this->returnValue($appState));
$context->expects($this->any())
->method('getResolver')
->will($this->returnValue($resolver));
$context->expects($this->any())
->method('getUrlBuilder')
->will($this->returnValue($urlBuilder));
$this->rendererPool = $this->getMockBuilder('Magento\Framework\Pricing\Render\RendererPool')
->disableOriginalConstructor()
......@@ -338,4 +366,9 @@ class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase
$this->assertEmpty($this->object->toHtml());
}
public function testGetCacheKeyInfo()
{
$this->assertArrayHasKey('display_minimal_price', $this->object->getCacheKeyInfo());
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment