Skip to content

Commit 516b529

Browse files
Fix PageCache: async rendering of blocks can corrupt layout cache #8554 #9050 #9560
Adapted PageCache and Framework tests
1 parent 2ae9c26 commit 516b529

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Framework\App\State;
99
use Magento\Framework\Phrase;
10+
use Magento\Framework\View\Layout\LayoutCacheKeyInterface;
1011

1112
/**
1213
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -66,7 +67,7 @@ class MergeTest extends \PHPUnit\Framework\TestCase
6667
protected $pageConfig;
6768

6869
/**
69-
* @var \Magento\Framework\View\Layout\LayoutCacheKeyInterface|\PHPUnit_Framework_MockObject_MockObject
70+
* @var LayoutCacheKeyInterface|\PHPUnit_Framework_MockObject_MockObject
7071
*/
7172
protected $layoutCacheKeyMock;
7273

@@ -124,7 +125,7 @@ function ($filename) use ($fileDriver) {
124125
)
125126
);
126127

127-
$this->layoutCacheKeyMock = $this->getMockForAbstractClass(\Magento\Framework\View\Layout\LayoutCacheKeyInterface::class);
128+
$this->layoutCacheKeyMock = $this->getMockForAbstractClass(LayoutCacheKeyInterface::class);
128129
$this->layoutCacheKeyMock->expects($this->any())
129130
->method('getCacheKeys')
130131
->willReturn([]);

dev/tests/integration/testsuite/Magento/Framework/View/Model/Layout/MergeTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Framework\View\Model\Layout;
77

8+
use Magento\Framework\View\Layout\LayoutCacheKeyInterface;
9+
810
class MergeTest extends \PHPUnit\Framework\TestCase
911
{
1012
/**
@@ -19,7 +21,7 @@ class MergeTest extends \PHPUnit\Framework\TestCase
1921
protected $model;
2022

2123
/**
22-
* @var \Magento\Framework\View\Layout\LayoutCacheKeyInterface|\PHPUnit_Framework_MockObject_MockObject
24+
* @var LayoutCacheKeyInterface|\PHPUnit_Framework_MockObject_MockObject
2325
*/
2426
protected $layoutCacheKeyMock;
2527

@@ -67,7 +69,7 @@ protected function setUp()
6769
$link2->setLayoutUpdateId($layoutUpdate2->getId());
6870
$link2->save();
6971

70-
$this->layoutCacheKeyMock = $this->getMockForAbstractClass(\Magento\Framework\View\Layout\LayoutCacheKeyInterface::class);
72+
$this->layoutCacheKeyMock = $this->getMockForAbstractClass(LayoutCacheKeyInterface::class);
7173
$this->layoutCacheKeyMock->expects($this->any())
7274
->method('getCacheKeys')
7375
->willReturn([]);

lib/internal/Magento/Framework/View/Model/Layout/CacheKey.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public function addCacheKeys($cacheKeys)
3636
*
3737
* @return array
3838
*/
39-
public function getCacheKeys() {
39+
public function getCacheKeys()
40+
{
4041
return $this->cacheKeys;
4142
}
4243
}

lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/MergeTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Framework\Config\Dom\ValidationSchemaException;
1010
use Magento\Framework\Phrase;
1111
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
12+
use Magento\Framework\View\Layout\LayoutCacheKeyInterface;
1213

1314
class MergeTest extends \PHPUnit\Framework\TestCase
1415
{
@@ -43,7 +44,7 @@ class MergeTest extends \PHPUnit\Framework\TestCase
4344
private $appState;
4445

4546
/**
46-
* @var \Magento\Framework\View\Layout\LayoutCacheKeyInterface|\PHPUnit_Framework_MockObject_MockObject
47+
* @var LayoutCacheKeyInterface|\PHPUnit_Framework_MockObject_MockObject
4748
*/
4849
protected $layoutCacheKeyMock;
4950

@@ -60,7 +61,7 @@ protected function setUp()
6061
->disableOriginalConstructor()
6162
->getMock();
6263

63-
$this->layoutCacheKeyMock = $this->getMockForAbstractClass(\Magento\Framework\View\Layout\LayoutCacheKeyInterface::class);
64+
$this->layoutCacheKeyMock = $this->getMockForAbstractClass(LayoutCacheKeyInterface::class);
6465
$this->layoutCacheKeyMock->expects($this->any())
6566
->method('getCacheKeys')
6667
->willReturn([]);

0 commit comments

Comments
 (0)