Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
invalidAclXmlArray.php
Go to the documentation of this file.
1 <?php
6 return [
7  'disabled_attribute_empty_value' => [
8  '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' .
9  'disabled=""/></resources></acl></config>',
10  [
11  "Element 'resource', attribute 'disabled': '' is not a valid value of the atomic" .
12  " type 'xs:boolean'.\nLine: 1\n"],
13  ],
14  'disabled_attribute_wrong_type_value' => [
15  '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' .
16  'disabled="notBool"/></resources></acl></config>',
17  [
18  "Element 'resource', attribute 'disabled': 'notBool' is not a valid value of the atomic type " .
19  "'xs:boolean'.\nLine: 1\n"
20  ],
21  ],
22  'double_acl' => [
23  '<?xml version="1.0"?><config><acl><resources></resources></acl><acl/></config>',
24  ["Element 'acl': This element is not expected.\nLine: 1\n"],
25  ],
26  'double_resource' => [
27  '<?xml version="1.0"?><config><acl><resources></resources><resources></resources></acl></config>',
28  ["Element 'resources': This element is not expected.\nLine: 1\n"],
29  ],
30  'less_minLength_title_attribute' => [
31  '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' .
32  'title="Sh"/></resources></acl></config>',
33  [
34  "Element 'resource', attribute 'title': [facet 'minLength'] The value 'Sh' has a length of '2'; " .
35  "this underruns the allowed minimum length of '3'.\nLine: 1\n",
36  "Element 'resource', attribute 'title': 'Sh' is not a valid value of the atomic type" .
37  " 'typeTitle'.\nLine: 1\n"
38  ],
39  ],
40  'more_maxLength_title_attribute' => [
41  '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar"' .
42  ' title="Lorem ipsum dolor sit amet, consectetur adipisicing"/></resources></acl></config>',
43  [
44  "Element 'resource', attribute 'title': [facet 'maxLength'] The value 'Lorem ipsum dolor sit amet, " .
45  "consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum" .
46  " length of '50'.\nLine: 1\n",
47  "Element 'resource', attribute 'title': 'Lorem ipsum dolor sit amet, consectetur adipisicing' is not " .
48  "a valid value of the atomic type 'typeTitle'.\nLine: 1\n"
49  ],
50  ],
51  'notvalid_id_attribute_value_regexp1' => [
52  '<?xml version="1.0"?><config><acl><resources><resource id="test_Value::show_toolbar"/>' .
53  '</resources></acl></config>',
54  [
55  "Element 'resource', attribute 'id': [facet 'pattern'] The value 'test_Value::show_toolbar' is " .
56  "not accepted by the pattern" .
57  " '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n",
58  "Element 'resource', attribute 'id': 'test_Value::show_toolbar' is not a valid value of the atomic type " .
59  "'typeId'.\nLine: 1\n",
60  "Element 'resource', attribute 'id': Warning: No precomputed value available, " .
61  "the value was either invalid or " .
62  "something strange happend.\nLine: 1\n"
63  ],
64  ],
65  'notvalid_id_attribute_value_regexp2' => [
66  '<?xml version="1.0"?><config><acl><resources><resource id="Test_value::show_toolbar"/>' .
67  '</resources></acl></config>',
68  [
69  "Element 'resource', attribute 'id': [facet 'pattern'] The value 'Test_value::show_toolbar' is not " .
70  "accepted by the 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",
71  "Element 'resource', attribute 'id': 'Test_value::show_toolbar' is not a valid value of the atomic type " .
72  "'typeId'.\nLine: 1\n",
73  "Element 'resource', attribute 'id': Warning: No precomputed value available, " .
74  "the value was either invalid or something strange happend.\nLine: 1\n"
75  ],
76  ],
77  'notvalid_id_attribute_value_regexp3' => [
78  '<?xml version="1.0"?><config><acl><resources><resource id="M@#$%^*_Value::show_toolbar"/>' .
79  '</resources></acl></config>',
80  [
81  "Element 'resource', attribute 'id': [facet 'pattern'] The value 'M@#$%^*_Value::show_toolbar' is not " .
82  "accepted by the 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",
83  "Element 'resource', attribute 'id': 'M@#$%^*_Value::show_toolbar' " .
84  "is not a valid value of the atomic type 'typeId'.\nLine: 1\n",
85  "Element 'resource', attribute 'id': Warning: No precomputed value available, " .
86  "the value was either invalid or something strange happend.\nLine: 1\n"
87  ],
88  ],
89  'notvalid_id_attribute_value_regexp4' => [
90  '<?xml version="1.0"?><config><acl><resources><resource id="_Value::show_toolbar"/>' .
91  '</resources></acl></config>',
92  [
93  "Element 'resource', attribute 'id': [facet 'pattern'] The value '_Value::show_toolbar' is not " .
94  "accepted by the 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",
95  "Element 'resource', attribute 'id': '_Value::show_toolbar' " .
96  "is not a valid value of the atomic type 'typeId'.\nLine: 1\n",
97  "Element 'resource', attribute 'id': " .
98  "Warning: No precomputed value available, the value was either invalid " .
99  "or something strange happend.\nLine: 1\n"
100  ],
101  ],
102  'notvalid_id_attribute_value_regexp5' => [
103  '<?xml version="1.0"?><config><acl><resources><resource id="Value_::show_toolbar"/></resources>' .
104  '</acl></config>',
105  [
106  "Element 'resource', attribute 'id': [facet 'pattern'] The value 'Value_::show_toolbar' is not " .
107  "accepted by the 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",
108  "Element 'resource', attribute 'id': 'Value_::show_toolbar' " .
109  "is not a valid value of the atomic type 'typeId'.\nLine: 1\n",
110  "Element 'resource', attribute 'id': " .
111  "Warning: No precomputed value available, the value was either invalid " .
112  "or something strange happend.\nLine: 1\n"
113  ],
114  ],
115  'notvalid_id_attribute_value_regexp6' => [
116  '<?xml version="1.0"?><config><acl><resources><resource id="Test_value:show_toolbar"/>' .
117  '</resources></acl></config>',
118  [
119  "Element 'resource', attribute 'id': [facet 'pattern'] The value 'Test_value:show_toolbar' is not " .
120  "accepted by the 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",
121  "Element 'resource', attribute 'id': 'Test_value:show_toolbar' is not a valid value of the atomic " .
122  "type 'typeId'.\nLine: 1\n",
123  "Element 'resource', attribute 'id': " .
124  "Warning: No precomputed value available, the value was either invalid " .
125  "or something strange happend.\nLine: 1\n"
126  ],
127  ],
128  'notvalid_id_attribute_value_regexp7' => [
129  '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::"/></resources>' . '</acl></config>',
130  [
131  "Element 'resource', attribute 'id': [facet 'pattern'] The value 'Test_Value::' is not accepted by " .
132  "the 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",
133  "Element 'resource', attribute 'id': 'Test_Value::' is not a valid value of the atomic type" .
134  " 'typeId'.\nLine: 1\n",
135  "Element 'resource', attribute 'id': " .
136  "Warning: No precomputed value available, the value was either invalid " .
137  "or something strange happend.\nLine: 1\n"
138  ],
139  ],
140  'sortOrder_attribute_empty_value' => [
141  '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' .
142  'title="Lorem ipsum" sortOrder="stringValue"/></resources></acl></config>',
143  [
144  "Element 'resource', attribute 'sortOrder': 'stringValue' is not a valid value of the atomic " .
145  "type 'xs:int'.\nLine: 1\n"
146  ],
147  ],
148  'sortOrder_attribute_wrong_type_value' => [
149  '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' .
150  'title="Lorem ipsum" sortOrder=""/></resources></acl></config>',
151  ["Element 'resource', attribute 'sortOrder': '' is not a valid value of the atomic type 'xs:int'.\nLine: 1\n"],
152  ],
153  'with_not_allowed_attribute' => [
154  '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' .
155  'someatrrname="some value"/></resources></acl></config>',
156  ["Element 'resource', attribute 'someatrrname': The attribute 'someatrrname' is not allowed.\nLine: 1\n"],
157  ],
158  'with_two_same_id' => [
159  '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' .
160  'title="Lorem ipsum"/><resource id="Test_Value::show_toolbar" title="Lorem ipsum"/>' .
161  '</resources></acl></config>',
162  [
163  "Element 'resource': Duplicate key-sequence ['Test_Value::show_toolbar'] in unique identity-constraint " .
164  "'uniqueResourceId'.\nLine: 1\n"
165  ],
166  ],
167  'without_acl' => [
168  '<?xml version="1.0"?><config/>',
169  ["Element 'config': Missing child element(s). Expected is ( acl ).\nLine: 1\n"],
170  ],
171  'without_required_id_attribute' => [
172  '<?xml version="1.0"?><config><acl><resources><resource title="Notifications"/></resources></acl></config>',
173  ["Element 'resource': The attribute 'id' is required but missing.\nLine: 1\n"],
174  ],
175  'without_resource' => [
176  '<?xml version="1.0"?><config><acl/></config>',
177  ["Element 'acl': Missing child element(s). Expected is ( resources ).\nLine: 1\n"],
178  ]
179 ];