Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Data
Test
Unit
Argument
_files
typesInvalidArray.php
Go to the documentation of this file.
1
<?php
6
return
[
7
'no arguments'
=> [
8
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />'
,
9
[
"Element 'arguments': Missing child element(s). Expected is ( argument ).\nLine: 1\n"
],
10
],
11
'argument without type'
=> [
12
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><argument/></arguments>'
,
13
[
"Element 'argument': The type definition is abstract.\nLine: 1\n"
],
14
],
15
'forbidden type used'
=> [
16
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
17
<argument name="a" xsi:type="forbiddenType">v</argument></arguments>'
,
18
[
19
"Element 'argument', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The QName value "
.
20
"'forbiddenType' of the xsi:type attribute does not resolve to a type definition.\nLine: 2\n"
,
21
"Element 'argument': The type definition is abstract.\nLine: 2\n"
22
],
23
],
24
'abstract type argumentType used'
=> [
25
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
26
<argument name="a" xsi:type="argumentType">v</argument></arguments>'
,
27
[
"Element 'argument': The type definition is abstract.\nLine: 2\n"
],
28
],
29
'no name attribute'
=> [
30
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
31
<argument xsi:type="number">v</argument></arguments>'
,
32
[
"Element 'argument': The attribute 'name' is required but missing.\nLine: 2\n"
],
33
],
34
'forbidden attribute'
=> [
35
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
36
<argument name="a" xsi:type="string" forbiddenAttribute="w">v</argument></arguments>'
,
37
[
38
"Element 'argument', attribute 'forbiddenAttribute': The attribute 'forbiddenAttribute'"
.
39
" is not allowed.\nLine: 2\n"
],
40
],
41
'forbidden translate attribute value for string'
=> [
42
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
43
<argument name="a" xsi:type="string" translate="forbidden">v</argument></arguments>'
,
44
[
45
"Element 'argument', attribute 'translate': 'forbidden' is not a valid value of the atomic type "
.
46
"'xs:boolean'.\nLine: 2\n"
47
],
48
],
49
'attribute translate for non-string'
=> [
50
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
51
<argument name="a" xsi:type="boolean" translate="true">true</argument></arguments>'
,
52
[
"Element 'argument', attribute 'translate': The attribute 'translate' is not allowed.\nLine: 2\n"
],
53
],
54
'null type should be empty'
=> [
55
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
56
<argument name="a" xsi:type="null">v</argument></arguments>'
,
57
[
"Element 'argument': Character content is not allowed, because the content type is empty.\nLine: 2\n"
],
58
],
59
'forbidden child node'
=> [
60
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
61
<argument name="a" xsi:type="string"><child>v</child></argument></arguments>'
,
62
[
"Element 'child': This element is not expected.\nLine: 2\n"
],
63
],
64
'array with forbidden child'
=> [
65
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
66
<argument name="a" xsi:type="array"><child>v</child></argument></arguments>'
,
67
[
"Element 'child': This element is not expected. Expected is ( item ).\nLine: 2\n"
],
68
],
69
'array with 2 same items'
=> [
70
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
71
<argument name="a" xsi:type="array">
72
<item name="name" xsi:type="string">v1</item>
73
<item name="name" xsi:type="string">v2</item>
74
</argument></arguments>'
,
75
[
"Element 'item': Duplicate key-sequence ['name'] in key identity-constraint 'argumentItemName'.\nLine: 4\n"
],
76
],
77
'array item without name'
=> [
78
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
79
<argument name="a" xsi:type="array"><item xsi:type="string">v</item></argument></arguments>'
,
80
[
81
"Element 'item': The attribute 'name' is required but missing.\nLine: 2\n"
,
82
"Element 'item': Not all fields of key identity-constraint 'argumentItemName'"
.
83
" evaluate to a node.\nLine: 2\n"
84
],
85
],
86
'array item with forbidden child'
=> [
87
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
88
<argument name="a" xsi:type="array">
89
<item name="item" xsi:type="string"><child>v</child></item>
90
</argument></arguments>'
,
91
[
"Element 'child': This element is not expected.\nLine: 3\n"
],
92
],
93
'nested array with same named items'
=> [
94
'<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
95
<argument name="a" xsi:type="array">
96
<item name="item1" xsi:type="string">v</item>
97
<item name="item2" xsi:type="array">
98
<item name="item1" xsi:type="string">v</item>
99
</item>
100
<item name="item3" xsi:type="array">
101
<item name="item4" xsi:type="string">v</item>
102
<item name="item4" xsi:type="string">v</item>
103
</item>
104
</argument></arguments>'
,
105
[
"Element 'item': Duplicate key-sequence ['item4'] in key identity-constraint 'itemName'.\nLine: 9\n"
],
106
]
107
];