Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
invalidSystemXmlArray.php
Go to the documentation of this file.
1 <?php
6 return [
7  'tab_id_not_unique' => [
8  '<?xml version="1.0"?><config><system><tab id="tab1"><label>Label One</label>' .
9  '</tab><tab id="tab1"><label>Label Two</label></tab></system></config>',
10  ["Element 'tab': Duplicate key-sequence ['tab1'] in unique identity-constraint 'uniqueTabId'.\nLine: 1\n"],
11  ],
12  'section_id_not_unique' => [
13  '<?xml version="1.0"?><config><system><section id="section1"><label>Label</label><tab>Tab</tab></section>' .
14  '<section id="section1"><label>Label_One</label><tab>Tab_One</tab></section></system></config>',
15  [
16  "Element 'section': Duplicate key-sequence ['section1'] " .
17  "in unique identity-constraint 'uniqueSectionId'.\nLine: 1\n"
18  ],
19  ],
20  'field_id_not_unique' => [
21  '<?xml version="1.0"?><config><system><section id="section1"><group id="group1">' .
22  '<label>Label</label><field id="field_id" /><field id="field_id" /></group>' .
23  '<group id="group2"><label>Label_One</label></group></section></system></config>',
24  [
25  "Element 'field': Duplicate key-sequence ['field_id'] in unique identity-constraint" .
26  " 'uniqueFieldId'.\nLine: 1\n"
27  ],
28  ],
29  'field_element_id_not_expected' => [
30  '<?xml version="1.0"?><config><system><section id="section1"><label>Label</label><field id="field_id">' .
31  '</field><field id="new_field_id"/></section></system></config>',
32  [
33  "Element 'field': This element is not expected.\nLine: 1\n"
34  ],
35  ],
36  'group_id_not_unique' => [
37  '<?xml version="1.0"?><config><system><section id="section1"><group id="group1">' .
38  '<label>Label</label></group>' .
39  '<group id="group1"><label>Label_One</label></group></section></system></config>',
40  [
41  "Element 'group': Duplicate key-sequence ['group1'] in unique identity-constraint" .
42  " 'uniqueGroupId'.\nLine: 1\n"
43  ],
44  ],
45  'group_is_not_expected' => [
46  '<?xml version="1.0"?><config><system><group id="group1"><label>Label</label><tab>Tab</tab></group>' .
47  '<group id="group1"><label>Label_One</label><tab>Tab_One</tab></group></system></config>',
48  ["Element 'group': This element is not expected. Expected is one of ( tab, section ).\nLine: 1\n"],
49  ],
50  'upload_dir_is_not_expected' => [
51  '<?xml version="1.0"?><config><system><section id="section1"><group id="group1">' .
52  '<label>Label</label><field id="field_id" /><upload_dir config="node_one/node_two/node_three" scope_info="1">' .
53  'node_one/node_two/node_three</upload_dir></group>' .
54  '<group id="group2"><label>Label_One</label></group></section></system></config>',
55  ["Element 'upload_dir': This element is not expected.\nLine: 1\n"],
56  ],
57  'upload_dir_with_invalid_type' => [
58  '<?xml version="1.0"?><config><system><section id="section1"><group id="group1">' .
59  '<label>Label</label><field id="field_id"><config_path>co</config_path>' .
60  '</field></group>' .
61  '<group id="group2"><label>Label_One</label></group></section></system></config>',
62  [
63  "Element 'config_path': [facet 'minLength'] The value has a length of '2'; this underruns " .
64  "the allowed minimum length of '5'.\nLine: 1\n",
65  "Element 'config_path': [facet 'pattern'] The value 'co' is not " .
66  "accepted by the pattern '[a-zA-Z0-9_\\\\]+/[a-zA-Z0-9_\\\\]+/[a-zA-Z0-9_\\\\]+'.\nLine: 1\n",
67  "Element 'config_path': 'co' is " . "not a valid value of the atomic type 'typeConfigPath'.\nLine: 1\n"
68  ],
69  ],
70  'if_module_enabled_with_invalid_type' => [
71  '<?xml version="1.0"?><config><system><section id="section1"><group id="group1">' .
72  '<label>Label</label><field id="field_id"><if_module_enabled>Som</if_module_enabled>' .
73  '</field></group>' .
74  '<group id="group2"><label>Label_One</label></group></section></system></config>',
75  [
76  "Element 'if_module_enabled': [facet 'minLength'] The value has a length of '3'; this underruns the " .
77  "allowed minimum length of '5'.\nLine: 1\n",
78  "Element 'if_module_enabled': [facet 'pattern'] The value 'Som' is not " .
79  "accepted by the pattern '[A-Z]+[a-zA-Z0-9]{1,}[_\\\\][A-Z]+[A-Z0-9a-z]{1,}'.\nLine: 1\n",
80  "Element 'if_module_enabled': 'Som' " . "is not a valid value of the atomic type 'typeModule'.\nLine: 1\n"
81  ],
82  ],
83  'id_minimum length' => [
84  '<?xml version="1.0"?><config><system><section id="s"><group id="gr">' .
85  '<label>Label</label><field id="f"></field></group><group id="group1"><label>Label</label></group></section>' .
86  '<tab id="h"><label>Label_One</label></tab></system></config>',
87  [
88  "Element 'section', attribute 'id': [facet 'minLength'] The value 's' has a length of '1'; this " .
89  "underruns the allowed minimum length of '2'.\nLine: 1\n",
90  "Element 'section', attribute 'id': 's' is not a valid value " . "of the atomic type 'typeId'.\nLine: 1\n",
91  "Element 'section', attribute 'id': Warning: No precomputed " .
92  "value available, the value was either invalid or something strange happend.\nLine: 1\n",
93  "Element 'field', attribute " .
94  "'id': [facet 'minLength'] The value 'f' has a length of '1'; this underruns the allowed minimum length " .
95  "of '2'.\nLine: 1\n",
96  "Element 'field', attribute 'id': 'f' is not a valid value of the atomic type 'typeId'.\nLine: 1\n",
97  "Element" .
98  " 'field', attribute 'id': " .
99  "Warning: No precomputed value available, the value was either invalid or something" .
100  " strange happend.\nLine: 1\n",
101  "Element 'tab', attribute 'id': [facet 'minLength'] The value 'h' has a length of '1'; " .
102  "this underruns the allowed minimum length of '2'.\nLine: 1\n",
103  "Element 'tab', attribute 'id': 'h' is not a valid value" . " of the atomic type 'typeId'.\nLine: 1\n",
104  "Element 'tab', attribute 'id': Warning: No precomputed value available, " .
105  "the value was either invalid or something strange happend.\nLine: 1\n"
106  ],
107  ],
108  'source_model_with_invalid_type' => [
109  '<?xml version="1.0"?><config><system><section id="section1"><group id="group1">' .
110  '<label>Label</label><field id="field_id"><source_model>Sour</source_model>' .
111  '</field></group>' .
112  '<group id="group2"><label>Label_One</label></group></section></system></config>',
113  [
114  "Element 'source_model': [facet 'minLength'] The value has a length of '4'; this underruns the allowed " .
115  "minimum length of '5'.\nLine: 1\n",
116  "Element 'source_model': 'Sour' is not a valid value of the atomic" . " type 'typeModel'.\nLine: 1\n"
117  ],
118  ],
119  'base_url_with_invalid_type' => [
120  '<?xml version="1.0"?><config><system><section id="section1"><resource>One:</resource>' .
121  '<group id="group1"><label>Label</label><field id="field_id"></field></group>' .
122  '<group id="group2"><label>Label_One</label></group></section></system></config>',
123  [
124  "Element 'resource': [facet 'minLength'] The value has a length of '4'; this underruns the allowed " .
125  "minimum length of '8'.\nLine: 1\n",
126  "Element 'resource': [facet 'pattern'] The value 'One:' is not accepted by the " .
127  "pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n",
128  "Element 'resource': 'One:' is not " . "a valid value of the atomic type 'typeAclResourceId'.\nLine: 1\n"
129  ],
130  ],
131  'advanced_with_invalid_type' => [
132  '<?xml version="1.0"?><config><system><section id="section1" advanced="string">' .
133  '<group id="group1"><label>Label</label><field id="field_id"></field></group>' .
134  '<group id="group2"><label>Label_One</label></group></section></system></config>',
135  [
136  "Element 'section', attribute 'advanced': 'string' is not a valid value of the atomic type " .
137  "'xs:boolean'.\nLine: 1\n"
138  ],
139  ],
140  'advanced_attribute_with_invalid_value' => [
141  '<?xml version="1.0"?><config><system><section id="section1" advanced="string">' .
142  '<group id="group1"><label>Label</label><field id="field_id" ></field></group>' .
143  '<group id="group2"><label>Label_One</label></group></section></system></config>',
144  [
145  "Element 'section', attribute 'advanced': 'string' is not a valid value of the atomic type " .
146  "'xs:boolean'.\nLine: 1\n"
147  ],
148  ],
149  'options_node_without_any_options' => [
150  '<?xml version="1.0"?><config><system><section id="section1" advanced="false">' .
151  '<group id="group1"><label>Label</label><field id="field_id"><options />' .
152  '</field></group><group id="group2"><label>Label_One</label></group></section></system></config>',
153  ["Element 'options': Missing child element(s). Expected is ( option ).\nLine: 1\n"],
154  ],
155  'system_node_without_allowed_elements' => [
156  '<?xml version="1.0"?><config><system/></config>',
157  ["Element 'system': Missing child element(s). Expected is one of ( tab, section ).\nLine: 1\n"],
158  ],
159  'config_node_without_allowed_elements' => [
160  '<?xml version="1.0"?><config></config>',
161  ["Element 'config': Missing child element(s). Expected is ( system ).\nLine: 1\n"],
162  ],
163  'config_without_required_attributes' => [
164  '<?xml version="1.0"?><config><system><section><group>' .
165  '<label>Label</label><attribute/><field><depends><field/></depends><options><option/></options></field>' .
166  '</group><group id="group2"><label>Label_One' .
167  '</label></group></section><tab><label>Label</label></tab></system>' .
168  '</config>',
169  [
170  "Element 'section': The attribute 'id' is required but missing.\nLine: 1\n",
171  "Element 'group': The attribute 'id' " . "is required but missing.\nLine: 1\n",
172  "Element 'attribute': The attribute 'type' is " . "required but missing.\nLine: 1\n",
173  "Element 'field': The attribute 'id' is required but missing.\nLine: 1\n",
174  "Element " . "'field': The attribute 'id' is required but missing.\nLine: 1\n",
175  "Element 'option': The attribute 'label' is " . "required but missing.\nLine: 1\n",
176  "Element 'tab': The attribute 'id' is required but missing.\nLine: 1\n"
177  ],
178  ],
179  'attribute_type_is_unique' => [
180  '<?xml version="1.0"?><config><system><section id="name"><group id="name">' .
181  '<label>Label</label><field id="name"><attribute type="one"/><attribute type="one"/></field>' .
182  '</group><group id="group2"><label>Label_One</label></group></section></system>' .
183  '</config>',
184  [
185  "Element 'attribute': Duplicate key-sequence ['one'] in unique identity-constraint " .
186  "'uniqueAttributeType'.\nLine: 1\n"
187  ],
188  ]
189 ];