Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
invalidImportXmlArray.php
Go to the documentation of this file.
1 <?php
6 return [
7  'entity_same_name_attribute_value' => [
8  '<?xml version="1.0"?><config><entity name="same_name"/><entity name="same_name"/></config>',
9  [
10  "Element 'entity': Duplicate key-sequence ['same_name'] in unique " .
11  "identity-constraint 'uniqueEntityName'.\nLine: 1\n"
12  ],
13  ],
14  'entity_without_required_name_attribute' => [
15  '<?xml version="1.0"?><config><entity /></config>',
16  ["Element 'entity': The attribute 'name' is required but missing.\nLine: 1\n"],
17  ],
18  'entity_with_invalid_model_value' => [
19  '<?xml version="1.0"?><config><entity name="some_name" model="12345"/></config>',
20  [
21  "Element 'entity', attribute 'model': [facet 'pattern'] The value '12345' is not accepted by " .
22  "the pattern '[A-Za-z_\\\\]+'.\nLine: 1\n",
23  "Element 'entity', attribute 'model': '12345' is not a valid value of the atomic type" .
24  " 'modelName'.\nLine: 1\n"
25  ],
26  ],
27  'entity_with_invalid_behaviormodel_value' => [
28  '<?xml version="1.0"?><config><entity name="some_name" behaviorModel="=--09"/></config>',
29  [
30  "Element 'entity', attribute 'behaviorModel': [facet 'pattern'] The value '=--09' is not " .
31  "accepted by the pattern '[A-Za-z_\\\\]+'.\nLine: 1\n",
32  "Element 'entity', attribute 'behaviorModel': '=--09' is not a valid value of the atomic type" .
33  " 'modelName'.\nLine: 1\n"
34  ],
35  ],
36  'entity_with_notallowed_attribute' => [
37  '<?xml version="1.0"?><config><entity name="some_name" notallowd="aasd"/></config>',
38  ["Element 'entity', attribute 'notallowd': The attribute 'notallowd' is not allowed.\nLine: 1\n"],
39  ],
40  'entitytype_without_required_name_attribute' => [
41  '<?xml version="1.0"?><config><entityType entity="entity_name" model="model_name" /></config>',
42  ["Element 'entityType': The attribute 'name' is required but missing.\nLine: 1\n"],
43  ],
44  'entitytype_without_required_model_attribute' => [
45  '<?xml version="1.0"?><config><entityType entity="entity_name" name="some_name" /></config>',
46  ["Element 'entityType': The attribute 'model' is required but missing.\nLine: 1\n"],
47  ],
48  'entitytype_with_invalid_model_attribute_value' => [
49  '<?xml version="1.0"?><config><entityType entity="entity_name" name="some_name" model="test1"/></config>',
50  [
51  "Element 'entityType', attribute 'model': [facet 'pattern'] The value 'test1' is not " .
52  "accepted by the pattern '[A-Za-z_\\\\]+'.\nLine: 1\n",
53  "Element 'entityType', attribute 'model': 'test1' is not a valid value of the atomic type" .
54  " 'modelName'.\nLine: 1\n"
55  ],
56  ],
57  'entitytype_with_notallowed' => [
58  '<?xml version="1.0"?><config><entityType entity="entity_name" name="some_name" '
59  . 'model="test" notallowed="test"/></config>',
60  ["Element 'entityType', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"],
61  ]
62 ];