File tree 2 files changed +14
-1
lines changed
lib/internal/Magento/Framework/Pricing
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ public function getCacheKey()
86
86
*/
87
87
protected function getCacheLifetime ()
88
88
{
89
- return parent ::hasCacheLifetime () ? parent ::getCacheLifetime () : self :: DEFAULT_LIFETIME ;
89
+ return parent ::hasCacheLifetime () ? parent ::getCacheLifetime () : null ;
90
90
}
91
91
92
92
/**
Original file line number Diff line number Diff line change @@ -241,4 +241,17 @@ public function testGetRendererPool()
241
241
{
242
242
$ this ->assertEquals ($ this ->rendererPool , $ this ->model ->getRendererPool ());
243
243
}
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
+ }
244
257
}
You can’t perform that action at this time.
0 commit comments