Skip to content

Commit a1e97f6

Browse files
MC-3030: Create/Update Integration Tests
- Update tests that verify config merging
1 parent db56e90 commit a1e97f6

File tree

6 files changed

+50
-15
lines changed

6 files changed

+50
-15
lines changed

dev/tests/integration/testsuite/Magento/PageBuilder/_files/content_type/expected_merged_array.php

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
'preview_component' => 'Path/to/preview/component',
3636
'master_component' => 'Path/to/master/component',
3737
'allowed_parents' => [
38-
0 => 'stage'
38+
0 => 'type3'
3939
],
4040
'appearances' => [
4141
'default' => [
@@ -229,8 +229,20 @@
229229
'form' => 'pagebuilder_type2_custom_form',
230230
'group' => 'group2',
231231
'allowed_parents' => [
232-
0 => 'stage',
233-
1 => 'type1'
232+
0 => 'type1'
233+
],
234+
'parents' => [
235+
'defaultPolicy' => 'deny',
236+
'types' => [
237+
['name' => 'stage', 'policy' => 'deny'],
238+
['name' => 'type1', 'policy' => 'allow']
239+
]
240+
],
241+
'children' => [
242+
'defaultPolicy' => 'deny',
243+
'types' => [
244+
['name' => 'type3', 'policy' => 'allow'],
245+
]
234246
],
235247
'appearances' => [
236248
'default' => [
@@ -649,6 +661,16 @@
649661
'allowed_parents' => [
650662
0 => 'stage'
651663
],
664+
'parents' => [
665+
'defaultPolicy' => 'deny',
666+
'types' => [
667+
['name' => 'stage', 'policy' => 'allow'],
668+
]
669+
],
670+
'children' => [
671+
'defaultPolicy' => 'allow',
672+
'types' => []
673+
],
652674
'appearances' => [
653675
'default' => [
654676
'preview_template' => 'Path/to/preview/template',

dev/tests/integration/testsuite/Magento/PageBuilder/_files/content_type/type1_content_type2.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/content_type.xsd">
99
<content_types>
1010
<type name="type1" translate="label" label="Type 1 Label" icon="pagebuilder-type1-custom-icon" component="Path/to/component" preview_component="Path/to/preview/component" form="pagebuilder_type1_custom_form" group="group2">
11-
<allowed_parents>
12-
<parent name="stage"/>
13-
</allowed_parents>
1411
<appearances>
1512
<appearance name="default" default="true" preview_template="Path/to/preview/template" render_template="Path/to/render/template" reader="Path/to/reader">
1613
<data_mapping>

dev/tests/integration/testsuite/Magento/PageBuilder/_files/content_type/type2_content_type1.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
<backend_block>Path/to/backend/block</backend_block>
1212
<backend_template>Path/to/backend/template</backend_template>
1313
<is_visible>true</is_visible>
14-
<allowed_parents>
15-
<parent name="stage"/>
16-
</allowed_parents>
14+
<parents default_policy="deny">
15+
<parent name="stage" policy="allow"/>
16+
</parents>
17+
<children default_policy="allow"/>
1718
<appearances>
1819
<appearance name="default" default="true" preview_template="Path/to/preview/template" render_template="Path/to/render/template" reader="Path/to/reader">
1920
<data name="data1">value1</data>

dev/tests/integration/testsuite/Magento/PageBuilder/_files/content_type/type2_content_type2.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111
<backend_block>Path/to/custom/backend/block</backend_block>
1212
<backend_template>Path/to/custom/backend/template</backend_template>
1313
<is_visible>false</is_visible>
14-
<allowed_parents>
15-
<parent name="type1"/>
16-
</allowed_parents>
14+
<parents>
15+
<parent name="stage" policy="deny"/>
16+
<parent name="type1" policy="allow"/>
17+
</parents>
18+
<children default_policy="deny">
19+
<child name="type3" policy="allow"/>
20+
</children>
1721
<appearances>
1822
<appearance name="default" default="true" preview_template="Path/to/preview/custom/template" render_template="Path/to/render/custom/template" reader="Path/to/custom/reader">
1923
<data name="data1">custom_value</data>

dev/tests/integration/testsuite/Magento/PageBuilder/_files/content_type/type3_content_type1.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/content_type.xsd">
99
<content_types>
1010
<type name="type3" translate="label" sortOrder="3" label="Type 3" icon="pagebuilder-type3-icon" component="Path/to/custom/component" form="pagebuilder_type3_form" group="group1">
11-
<allowed_parents>
12-
<parent name="stage"/>
13-
</allowed_parents>
11+
<parents default_policy="deny">
12+
<parent name="stage" policy="allow"/>
13+
</parents>
14+
<children default_policy="allow"/>
1415
<appearances>
1516
<appearance name="default" default="true" preview_template="Path/to/preview/template" render_template="Path/to/render/template" reader="Path/to/reader">
1617
<data_mapping>

dev/tests/integration/testsuite/Magento/PageBuilder/_files/content_type/type3_expected_merged_array.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818
'allowed_parents' => [
1919
0 => 'stage'
2020
],
21+
'parents' => [
22+
'defaultPolicy' => 'deny',
23+
'types' => [
24+
['name' => 'stage', 'policy' => 'allow']
25+
]
26+
],
27+
'children' => [
28+
'defaultPolicy' => 'allow',
29+
'types' => []
30+
],
2131
'appearances' => [
2232
'default' => [
2333
'preview_template' => 'Path/to/preview/template',

0 commit comments

Comments
 (0)