Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ protected function getCacheLifetime()

$cacheLifetime = $this->getData('cache_lifetime');
if (false === $cacheLifetime || null === $cacheLifetime) {
return $cacheLifetime;
return null;
}

return (int)$cacheLifetime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ public function getCacheLifetimeDataProvider()
'dataFromCache' => 'dataFromCache',
'dataForSaveCache' => '',
'expectsDispatchEvent' => $this->exactly(2),
'expectsCacheLoad' => $this->once(),
'expectsCacheLoad' => $this->never(),
'expectsCacheSave' => $this->never(),
'expectedResult' => 'dataFromCache',
'expectedResult' => '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good. It would better use null for expected result because we started return null in lib/internal/Magento/Framework/View/Element/AbstractBlock.php line: 1077

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sidolov I tried with null for the expected result in the first two datasets but it does not work when running the unit test.

],
[
'cacheLifetime' => 120,
Expand Down