Skip to content

Commit dd8d0ef

Browse files
sdwrighthostep
authored andcommitted
Backport of MAGETWO-59089 for Magento 2.1: Magento 2.1.1 Problem with change currency
Fixed issues: - MAGETWO-59089 [Github]Magento 2.1.1 Problem with change currency magento#6746 (cherry picked from commit a9510d3)
1 parent 118a197 commit dd8d0ef

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,17 @@ public function testGetRendererPool()
233233
{
234234
$this->assertEquals($this->rendererPool, $this->model->getRendererPool());
235235
}
236+
237+
/**
238+
* This tests ensures that protected method getCacheLifetime() returns a null value when cacheLifeTime is not
239+
* explicitly set in the parent block
240+
*/
241+
public function testCacheLifetime()
242+
{
243+
$reflectionClass = new \ReflectionClass(get_class($this->model));
244+
$methodReflection = $reflectionClass->getMethod('getCacheLifetime');
245+
$methodReflection->setAccessible(true);
246+
$cacheLifeTime = $methodReflection->invoke($this->model);
247+
$this->assertNull($cacheLifeTime, 'Expected null cache lifetime');
248+
}
236249
}

0 commit comments

Comments
 (0)