Skip to content

Commit b1ccb76

Browse files
MC-2220: Update Integration Tests
- update content types and groups integration tests
1 parent 7ae75c1 commit b1ccb76

12 files changed

+101
-168
lines changed

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

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@
77
'groups' => [
88
'group1' => [
99
'label' => 'Group 1',
10-
'sortOrder' => '1'
10+
'sortOrder' => '1',
11+
'name' => 'group1',
12+
'translate' => 'label'
1113
],
1214
'group2' => [
1315
'label' => 'Group 2 Label',
14-
'sortOrder' => '3'
16+
'sortOrder' => '3',
17+
'name' => 'group2',
18+
'translate' => 'label'
1519
],
1620
'group3' => [
1721
'label' => 'Group 3 Label',
18-
'sortOrder' => '2'
19-
],
22+
'sortOrder' => '2',
23+
'name' => 'group3',
24+
'translate' => 'label'
25+
]
2026
],
2127
'types' => [
2228
'type1' => [
@@ -35,9 +41,7 @@
3541
'default' => [
3642
'preview_template' => 'Path/to/preview/template',
3743
'render_template' => 'Path/to/render/template',
38-
'readers' => [
39-
0 => 'Path/to/reader'
40-
],
44+
'readers' => [],
4145
'data_mapping' => [
4246
'elements' => [
4347
'main' => [
@@ -81,7 +85,8 @@
8185
],
8286
'converters' => []
8387
],
84-
'default' => 'true'
88+
'default' => 'true',
89+
'reader' => 'Path/to/reader'
8590
]
8691
],
8792
'additional_data' => [
@@ -209,6 +214,8 @@
209214
. 'ContentType\\AdditionalData\\Provider\\TestData',
210215
],
211216
],
217+
'name' => 'type1',
218+
'translate' => 'label'
212219
],
213220
'type2' => [
214221
'sortOrder' => '2',
@@ -232,11 +239,7 @@
232239
'data3' => 'value3',
233240
'preview_template' => 'Path/to/preview/custom/template',
234241
'render_template' => 'Path/to/render/custom/template',
235-
'readers' => [
236-
0 => 'Path/to/custom/reader1',
237-
1 => 'Path/to/reader2',
238-
2 => 'Path/to/custom/reader3',
239-
],
242+
'readers' => [],
240243
'data_mapping' => [
241244
'elements' => [
242245
'first_element' => [
@@ -513,14 +516,13 @@
513516
]
514517
],
515518
'default' => 'true',
516-
'form' => 'Path/to/custom/form'
519+
'form' => 'Path/to/custom/form',
520+
'reader' => 'Path/to/custom/reader'
517521
],
518522
'appearance1' => [
519523
'preview_template' => 'Path/to/preview/template',
520524
'render_template' => 'Path/to/render/template',
521-
'readers' => [
522-
0 => 'Path/to/reader'
523-
],
525+
'readers' => [],
524526
'data_mapping' => [
525527
'elements' => [
526528
'main' => [
@@ -565,28 +567,27 @@
565567
'converters' => []
566568
],
567569
'default' => 'false',
568-
'form' => 'Path/to/form'
570+
'form' => 'Path/to/form',
571+
'reader' => 'Path/to/reader'
569572
],
570573
'appearance2' => [
571574
'preview_template' => 'Path/to/preview/template',
572575
'render_template' => 'Path/to/render/template',
573-
'readers' => [
574-
0 => 'Path/to/reader'
575-
],
576-
'default' => 'false'
576+
'readers' => [],
577+
'default' => 'false',
578+
'reader' => 'Path/to/reader'
577579
],
578580
'appearance3' => [
579581
'preview_template' => 'Path/to/preview/template',
580582
'render_template' => 'Path/to/render/template',
581583
'readers' => [],
582-
'default' => 'false'
584+
'default' => 'false',
585+
'reader' => null
583586
],
584587
'appearance4' => [
585588
'preview_template' => 'Path/to/preview/template',
586589
'render_template' => 'Path/to/render/template',
587-
'readers' => [
588-
0 => 'Path/to/reader'
589-
],
590+
'readers' => [],
590591
'data_mapping' => [
591592
'elements' => [
592593
'main' => [
@@ -631,9 +632,12 @@
631632
'converters' => []
632633
],
633634
'default' => null,
634-
'form' => 'Path/to/custom/form'
635+
'form' => 'Path/to/custom/form',
636+
'reader' => 'Path/to/reader'
635637
]
636-
]
638+
],
639+
'name' => 'type2',
640+
'translate' => 'label'
637641
],
638642
'type3' => [
639643
'sortOrder' => '3',
@@ -649,9 +653,7 @@
649653
'default' => [
650654
'preview_template' => 'Path/to/preview/template',
651655
'render_template' => 'Path/to/render/template',
652-
'readers' => [
653-
0 => 'Path/to/reader'
654-
],
656+
'readers' => [],
655657
'data_mapping' => [
656658
'elements' => [
657659
'main' => [
@@ -695,9 +697,12 @@
695697
],
696698
'converters' => []
697699
],
698-
'default' => 'true'
700+
'default' => 'true',
701+
'reader' => 'Path/to/reader'
699702
]
700-
]
703+
],
704+
'name' => 'type3',
705+
'translate' => 'label'
701706
]
702707
]
703708
];

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/group.xsd">
99
<groups>
10-
<group name="group1" translate="label" sortOrder="1">
11-
<label>Group 1</label>
12-
</group>
13-
<group name="group2" translate="label" sortOrder="2">
14-
<label>Group 2</label>
15-
</group>
10+
<group name="group1" translate="label" sortOrder="1" label="Group 1"/>
11+
<group name="group2" translate="label" sortOrder="2" label="Group 2"/>
1612
</groups>
1713
</config>

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/group.xsd">
99
<groups>
10-
<group name="group2" translate="label" sortOrder="3">
11-
<label>Group 2 Label</label>
12-
</group>
13-
<group name="group3" translate="label" sortOrder="2">
14-
<label>Group 3</label>
15-
</group>
10+
<group name="group2" translate="label" sortOrder="3" label="Group 2 Label"/>
11+
<group name="group3" translate="label" sortOrder="2" label="Group 3"/>
1612
</groups>
1713
</config>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/group.xsd">
99
<groups>
10-
<group name="group3">
11-
<label>Group 3 Label</label>
12-
</group>
10+
<group name="group3" label="Group 3 Label"/>
1311
</groups>
1412
</config>

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,21 @@
1010
'groups' => [
1111
'group1' => [
1212
'label' => 'Group 1',
13-
'sortOrder' => '1'
13+
'sortOrder' => '1',
14+
'name' => 'group1',
15+
'translate' => 'label'
1416
],
1517
'group2' => [
1618
'label' => 'Group 2 Label',
17-
'sortOrder' => '3'
19+
'sortOrder' => '3',
20+
'name' => 'group2',
21+
'translate' => 'label'
1822
],
1923
'group3' => [
2024
'label' => 'Group 3 Label',
21-
'sortOrder' => '2'
25+
'sortOrder' => '2',
26+
'name' => 'group3',
27+
'translate' => 'label'
2228
],
2329
]
2430
];

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@
77
-->
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>
10-
<type name="type1" translate="label" sortOrder="1">
11-
<label>Type 1</label>
12-
<icon>pagebuilder-type1-icon</icon>
13-
<component>Path/to/component</component>
14-
<master_component>Path/to/master/component</master_component>
15-
<form>pagebuilder_type1_form</form>
16-
<group>group1</group>
10+
<type name="type1" translate="label" sortOrder="1" label="Type 1" icon="pagebuilder-type1-icon" component="Path/to/component" master_component="Path/to/master/component" form="pagebuilder_type1_form" group="group1">
1711
</type>
1812
</content_types>
1913
</config>

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

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@
77
-->
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>
10-
<type name="type1" translate="label">
11-
<label>Type 1 Label</label>
12-
<icon>pagebuilder-type1-custom-icon</icon>
13-
<component>Path/to/component</component>
14-
<preview_component>Path/to/preview/component</preview_component>
15-
<form>pagebuilder_type1_custom_form</form>
16-
<group>group2</group>
10+
<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">
1711
<allowed_parents>
1812
<parent name="stage"/>
1913
</allowed_parents>
2014
<appearances>
21-
<appearance name="default" default="true">
15+
<appearance name="default" default="true" preview_template="Path/to/preview/template" render_template="Path/to/render/template" reader="Path/to/reader">
2216
<data_mapping>
2317
<elements>
2418
<element name="main" path=".">
@@ -33,39 +27,36 @@
3327
</element>
3428
</elements>
3529
</data_mapping>
36-
<preview_template>Path/to/preview/template</preview_template>
37-
<render_template>Path/to/render/template</render_template>
38-
<reader>Path/to/reader</reader>
3930
</appearance>
4031
</appearances>
4132
<additional_data>
42-
<arguments name="config1" xsi:type="array">
33+
<item name="config1" xsi:type="array">
4334
<item name="settingWithTypeString" xsi:type="string">string</item>
4435
<item name="settingWithTypeBooleanTrue" xsi:type="boolean">true</item>
4536
<item name="settingWithTypeBooleanFalse" xsi:type="boolean">false</item>
4637
<item name="settingWithTypeInteger" xsi:type="number">20</item>
47-
<item name="settingWithTypeNull" xsi:type="null" />
38+
<item name="settingWithTypeNull" xsi:type="null"/>
4839
<item name="settingWithTypeNumber2" xsi:type="number">-90</item>
4940
<item name="settingWithTypeObject" xsi:type="object">Magento\TestModulePageBuilderDataMigration\Model\Config\ContentType\AdditionalData\Provider\TestData</item>
50-
</arguments>
51-
<arguments name="config2" xsi:type="array">
41+
</item>
42+
<item name="config2" xsi:type="array">
5243
<item name="arrayConfig" xsi:type="array">
5344
<item name="settingWithTypeString" xsi:type="string">string</item>
5445
<item name="settingWithTypeBooleanTrue" xsi:type="boolean">true</item>
5546
<item name="settingWithTypeBooleanFalse" xsi:type="boolean">false</item>
5647
<item name="settingWithTypeInteger" xsi:type="number">20</item>
57-
<item name="settingWithTypeNull" xsi:type="null" />
48+
<item name="settingWithTypeNull" xsi:type="null"/>
5849
<item name="settingWithTypeNumber2" xsi:type="number">-90</item>
5950
<item name="settingWithTypeObject" xsi:type="object">Magento\TestModulePageBuilderDataMigration\Model\Config\ContentType\AdditionalData\Provider\TestData</item>
6051
</item>
61-
</arguments>
62-
<arguments name="settingWithTypeString" xsi:type="string">string</arguments>
63-
<arguments name="settingWithTypeBooleanTrue" xsi:type="boolean">true</arguments>
64-
<arguments name="settingWithTypeBooleanFalse" xsi:type="boolean">false</arguments>
65-
<arguments name="settingWithTypeInteger" xsi:type="number">20</arguments>
66-
<arguments name="settingWithTypeNull" xsi:type="null" />
67-
<arguments name="settingWithTypeNumber2" xsi:type="number">-90</arguments>
68-
<arguments name="settingWithTypeObject" xsi:type="object">Magento\TestModulePageBuilderDataMigration\Model\Config\ContentType\AdditionalData\Provider\TestData</arguments>
52+
</item>
53+
<item name="settingWithTypeString" xsi:type="string">string</item>
54+
<item name="settingWithTypeBooleanTrue" xsi:type="boolean">true</item>
55+
<item name="settingWithTypeBooleanFalse" xsi:type="boolean">false</item>
56+
<item name="settingWithTypeInteger" xsi:type="number">20</item>
57+
<item name="settingWithTypeNull" xsi:type="null"/>
58+
<item name="settingWithTypeNumber2" xsi:type="number">-90</item>
59+
<item name="settingWithTypeObject" xsi:type="object">Magento\TestModulePageBuilderDataMigration\Model\Config\ContentType\AdditionalData\Provider\TestData</item>
6960
</additional_data>
7061
</type>
7162
</content_types>

0 commit comments

Comments
 (0)