|
1 | 1 | <?php |
2 | 2 | /** |
3 | | - * Copyright 2016 Adobe |
4 | | - * All Rights Reserved. |
| 3 | + * Copyright © Magento, Inc. All rights reserved. |
| 4 | + * See COPYING.txt for license details. |
5 | 5 | */ |
6 | 6 | namespace Magento\PageCache\Model\Layout; |
7 | 7 |
|
@@ -29,20 +29,10 @@ public function testLoadEntitySpecificHandleWithEsiBlock() |
29 | 29 |
|
30 | 30 | /** @var EntitySpecificHandlesList $entitySpecificHandleList */ |
31 | 31 | $entitySpecificHandleList = $objectManager->get(EntitySpecificHandlesList::class); |
32 | | - |
33 | | - // Register test layout file with ttl attribute |
34 | | - $testHandle = 'test_layout_with_ttl'; |
35 | | - |
36 | | - // Add this handle to entity-specific list to trigger validation |
37 | | - $entitySpecificHandleList->addHandle($testHandle); |
38 | | - |
39 | | - // Manually add the layout XML from test fixture |
40 | | - $layoutXml = file_get_contents(__DIR__ . '/../../_files/test_layout_with_ttl.xml'); |
41 | | - $layoutMerge->addUpdate($layoutXml); |
42 | | - |
43 | | - // This throws exception when loading |
44 | | - // because test_layout_with_ttl is marked as entity-specific |
45 | | - // and contains a block with ttl |
46 | | - $layoutMerge->load([$testHandle]); |
| 32 | + // Add 'default' handle, which has declarations of blocks with ttl, to the list of entity specific handles. |
| 33 | + // This allows to simulate a situation, when block with ttl attribute |
| 34 | + // is declared e.g. in 'catalog_product_view_id_1' handle |
| 35 | + $entitySpecificHandleList->addHandle('default'); |
| 36 | + $layoutMerge->load(['default']); |
47 | 37 | } |
48 | 38 | } |
0 commit comments