File tree Expand file tree Collapse file tree 2 files changed +29
-6
lines changed
dev/tests/integration/testsuite/Magento/PageCache Expand file tree Collapse file tree 2 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,25 @@ public function testLoadEntitySpecificHandleWithEsiBlock()
3030 /** @var EntitySpecificHandlesList $entitySpecificHandleList */
3131 $ entitySpecificHandleList = $ objectManager ->get (EntitySpecificHandlesList::class);
3232
33- // Register test handle as entity-specific
34- $ testHandle = 'default ' ;
33+ // Register test layout with ttl attribute
34+ $ testHandle = 'test_entity_specific_handle ' ;
35+
36+ // Add this handle to entity-specific list to trigger validation
3537 $ entitySpecificHandleList ->addHandle ($ testHandle );
3638
37- // Simple XML with ttl attribute that should trigger the validation
38- $ layoutXml = '<block class="Magento\Framework\View\Element\Template" name="test.block" ttl="3600"/> ' ;
39+ // Layout XML with ttl attribute (without XML declaration to avoid parsing issues)
40+ $ layoutXml = <<<XML
41+ <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
42+ <body>
43+ <block class="Magento\Framework\View\Element\Template" name="test.block.with.ttl" template="Magento_Theme::html/notices.phtml" ttl="3600"/>
44+ </body>
45+ </page>
46+ XML ;
47+
48+ $ layoutMerge ->addUpdate ($ layoutXml );
3949
40- // This should throw exception because the handle is entity-specific and contains ttl
41- $ layoutMerge ->validateUpdate ($ testHandle , $ layoutXml );
50+ // This should throw exception when loading because test_entity_specific_handle
51+ // is marked as entity-specific and contains a block with ttl
52+ $ layoutMerge ->load ([$ testHandle ]);
4253 }
4354}
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <!--
3+ /**
4+ * Copyright 2025 Adobe
5+ * All Rights Reserved.
6+ */
7+ -->
8+ <page xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:View/Layout/etc/page_configuration.xsd" >
9+ <body >
10+ <block class =" Magento\Framework\View\Element\Template" name =" test.block.with.ttl" template =" Magento_Theme::html/notices.phtml" ttl =" 3600" />
11+ </body >
12+ </page >
You can’t perform that action at this time.
0 commit comments