Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
invalidResourcesXmlArray.php
Go to the documentation of this file.
1 <?php
6 return [
7  'without_required_resource_handle' => [
8  '<?xml version="1.0"?><config></config>',
9  ["Element 'config': Missing child element(s). Expected is ( resource ).\nLine: 1\n"],
10  ],
11  'resource_without_required_name_attribute' => [
12  '<?xml version="1.0"?><config><resource /></config>',
13  ["Element 'resource': The attribute 'name' is required but missing.\nLine: 1\n"],
14  ],
15  'resource_name_attribute_invalid_value' => [
16  '<?xml version="1.0"?><config><resource name="testinvalidname$" /></config>',
17  [
18  "Element 'resource', attribute 'name': [facet 'pattern'] The value 'testinvalidname$' is not accepted" .
19  " by the pattern '[A-Za-z_0-9]+'.\nLine: 1\n",
20  "Element 'resource', attribute 'name': 'testinvalidname$' is not a valid value of the atomic " .
21  "type 'nameIdentifier'.\nLine: 1\n",
22  "Element 'resource', attribute 'name': Warning: No precomputed value available, the value was either " .
23  "invalid or something strange happend.\nLine: 1\n"
24  ],
25  ],
26  'resource_extends_attribute_invalid_value' => [
27  '<?xml version="1.0"?><config><resource name="test_name" extends="test@"/></config>',
28  [
29  "Element 'resource', attribute 'extends': [facet 'pattern'] The value 'test@' is not accepted " .
30  "by the pattern '[A-Za-z_0-9]+'.\nLine: 1\n",
31  "Element 'resource', attribute 'extends': 'test@' is not a valid value of the atomic" .
32  " type 'nameIdentifier'.\nLine: 1\n"
33  ],
34  ],
35  'resource_connection_attribute_invalid_value' => [
36  '<?xml version="1.0"?><config><resource name="test_name" connection="test#"/></config>',
37  [
38  "Element 'resource', attribute 'connection': [facet 'pattern'] The value 'test#' is not accepted " .
39  "by the pattern '[A-Za-z_0-9]+'.\nLine: 1\n",
40  "Element 'resource', attribute 'connection': 'test#' is not a valid value of the atomic" .
41  " type 'nameIdentifier'.\nLine: 1\n"
42  ],
43  ],
44  'resource_with_notallowed_attribute' => [
45  '<?xml version="1.0"?><config><resource name="test_name" notallowed="test" /></config>',
46  ["Element 'resource', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"],
47  ],
48  'resource_with_same_name_value' => [
49  '<?xml version="1.0"?><config><resource name="test_name" /><resource name="test_name" /></config>',
50  [
51  "Element 'resource': Duplicate key-sequence ['test_name'] in unique " .
52  "identity-constraint 'uniqueResourceName'.\nLine: 1\n"
53  ],
54  ]
55 ];