Skip to content

Commit a9510d3

Browse files
authored
Merge pull request #465 from magento-fearless-kiwis/FearlessKiwis-MAGETWO-59089
Fixed issues: - MAGETWO-59089 [Github]Magento 2.1.1 Problem with change currency #6746
2 parents 2cacd80 + 959f2a1 commit a9510d3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/internal/Magento/Framework/Pricing/Render/PriceBox.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function getCacheKey()
8686
*/
8787
protected function getCacheLifetime()
8888
{
89-
return parent::hasCacheLifetime() ? parent::getCacheLifetime() : self::DEFAULT_LIFETIME;
89+
return parent::hasCacheLifetime() ? parent::getCacheLifetime() : null;
9090
}
9191

9292
/**

lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php

+13
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,17 @@ public function testGetRendererPool()
241241
{
242242
$this->assertEquals($this->rendererPool, $this->model->getRendererPool());
243243
}
244+
245+
/**
246+
* This tests ensures that protected method getCacheLifetime() returns a null value when cacheLifeTime is not
247+
* explicitly set in the parent block
248+
*/
249+
public function testCacheLifetime()
250+
{
251+
$reflectionClass = new \ReflectionClass(get_class($this->model));
252+
$methodReflection = $reflectionClass->getMethod('getCacheLifetime');
253+
$methodReflection->setAccessible(true);
254+
$cacheLifeTime = $methodReflection->invoke($this->model);
255+
$this->assertNull($cacheLifeTime, 'Expected null cache lifetime');
256+
}
244257
}

0 commit comments

Comments
 (0)