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 @@ -233,4 +233,17 @@ public function testGetRendererPool()
233
233
{
234
234
$ this ->assertEquals ($ this ->rendererPool , $ this ->model ->getRendererPool ());
235
235
}
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
+ }
236
249
}
You can’t perform that action at this time.
0 commit comments