Skip to content

Commit 867d074

Browse files
authored
Merge pull request #8408 from magento-gl/comm_jul
[Bluetooth] Community Pull Requests delivery
2 parents a88f1cc + 5285c61 commit 867d074

File tree

129 files changed

+4467
-1400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+4467
-1400
lines changed

app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php

Lines changed: 314 additions & 128 deletions
Large diffs are not rendered by default.

app/code/Magento/Catalog/Plugin/CategoryAuthorization.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public function __construct(Authorization $authorization)
3838
* @param CategoryInterface $category
3939
* @throws LocalizedException
4040
* @return array
41-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4241
*/
4342
public function beforeSave(CategoryRepositoryInterface $subject, CategoryInterface $category): array
4443
{

app/code/Magento/Catalog/Plugin/ProductAuthorization.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public function __construct(Authorization $authorization)
3939
* @param bool $saveOptions
4040
* @throws LocalizedException
4141
* @return array
42-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4342
*/
4443
public function beforeSave(
4544
ProductRepositoryInterface $subject,

app/code/Magento/Catalog/Plugin/RemoveImagesFromGalleryAfterRemovingProduct.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function __construct(Gallery $galleryResource, ReadHandler $mediaGalleryR
4545
* @param callable $proceed
4646
* @param ProductInterface $product
4747
* @return bool
48-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4948
*/
5049
public function aroundDelete(
5150
ProductRepositoryInterface $subject,

app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/XsdTest.php

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22
/**
3-
* Test for validation rules implemented by XSD schema for catalog attributes configuration
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
@@ -55,39 +53,70 @@ public function exemplarXmlDataProvider()
5553
'valid' => ['<config><group name="test"><attribute name="attr"/></group></config>', []],
5654
'empty root node' => [
5755
'<config/>',
58-
["Element 'config': Missing child element(s). Expected is ( group )."],
56+
[
57+
"Element 'config': Missing child element(s). Expected is ( group ).The xml was: \n" .
58+
"0:<?xml version=\"1.0\"?>\n1:<config/>\n2:\n"
59+
],
5960
],
6061
'irrelevant root node' => [
6162
'<attribute name="attr"/>',
62-
["Element 'attribute': No matching global declaration available for the validation root."],
63+
[
64+
"Element 'attribute': No matching global declaration available for the validation root.The " .
65+
"xml was: \n0:<?xml version=\"1.0\"?>\n1:<attribute name=\"attr\"/>\n2:\n"
66+
],
6367
],
6468
'empty node "group"' => [
6569
'<config><group name="test"/></config>',
66-
["Element 'group': Missing child element(s). Expected is ( attribute )."],
70+
[
71+
"Element 'group': Missing child element(s). Expected is ( attribute ).The xml was: \n" .
72+
"0:<?xml version=\"1.0\"?>\n1:<config><group name=\"test\"/></config>\n2:\n"
73+
],
6774
],
6875
'node "group" without attribute "name"' => [
6976
'<config><group><attribute name="attr"/></group></config>',
70-
["Element 'group': The attribute 'name' is required but missing."],
77+
[
78+
"Element 'group': The attribute 'name' is required but missing.The xml was: \n" .
79+
"0:<?xml version=\"1.0\"?>\n1:<config><group><attribute name=\"attr\"/></group></config>\n2:\n"
80+
],
7181
],
7282
'node "group" with invalid attribute' => [
7383
'<config><group name="test" invalid="true"><attribute name="attr"/></group></config>',
74-
["Element 'group', attribute 'invalid': The attribute 'invalid' is not allowed."],
84+
[
85+
"Element 'group', attribute 'invalid': The attribute 'invalid' is not allowed.The xml was: \n" .
86+
"0:<?xml version=\"1.0\"?>\n1:<config><group name=\"test\" invalid=\"true\">" .
87+
"<attribute name=\"attr\"/></group></config>\n2:\n"
88+
],
7589
],
7690
'node "attribute" with value' => [
7791
'<config><group name="test"><attribute name="attr">Invalid</attribute></group></config>',
78-
["Element 'attribute': Character content is not allowed, because the content type is empty."],
92+
[
93+
"Element 'attribute': Character content is not allowed, because the content type is empty." .
94+
"The xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><group name=\"test\">" .
95+
"<attribute name=\"attr\">Invalid</attribute></group></config>\n2:\n"
96+
],
7997
],
8098
'node "attribute" with children' => [
8199
'<config><group name="test"><attribute name="attr"><invalid/></attribute></group></config>',
82-
["Element 'attribute': Element content is not allowed, because the content type is empty."],
100+
[
101+
"Element 'attribute': Element content is not allowed, because the content type is empty." .
102+
"The xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><group name=\"test\">" .
103+
"<attribute name=\"attr\"><invalid/></attribute></group></config>\n2:\n"
104+
],
83105
],
84106
'node "attribute" without attribute "name"' => [
85107
'<config><group name="test"><attribute/></group></config>',
86-
["Element 'attribute': The attribute 'name' is required but missing."],
108+
[
109+
"Element 'attribute': The attribute 'name' is required but missing.The xml was: \n" .
110+
"0:<?xml version=\"1.0\"?>\n1:<config><group name=\"test\"><attribute/></group></config>\n2:\n"
111+
],
87112
],
88113
'node "attribute" with invalid attribute' => [
89114
'<config><group name="test"><attribute name="attr" invalid="true"/></group></config>',
90-
["Element 'attribute', attribute 'invalid': The attribute 'invalid' is not allowed."],
115+
[
116+
"Element 'attribute', attribute 'invalid': The attribute 'invalid' is not allowed.The xml " .
117+
"was: \n0:<?xml version=\"1.0\"?>\n1:<config><group name=\"test\"><attribute " .
118+
"name=\"attr\" invalid=\"true\"/></group></config>\n2:\n"
119+
],
91120
]
92121
];
93122
}

app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsMergedXmlArray.php

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,54 @@
88
return [
99
'options_node_is_required' => [
1010
'<?xml version="1.0"?><config><inputType name="name_one" label="Label One"/></config>',
11-
["Element 'inputType': This element is not expected. Expected is ( option ).\nLine: 1\n"],
11+
[
12+
"Element 'inputType': This element is not expected. Expected is ( option ).\nLine: 1\nThe xml was: \n" .
13+
"0:<?xml version=\"1.0\"?>\n1:<config><inputType name=\"name_one\" label=\"Label One\"/></config>\n2:\n"
14+
],
1215
],
1316
'inputType_node_is_required' => [
1417
'<?xml version="1.0"?><config><option name="name_one" label="Label One" renderer="one"/></config>',
15-
["Element 'option': Missing child element(s). Expected is ( inputType ).\nLine: 1\n"],
18+
[
19+
"Element 'option': Missing child element(s). Expected is ( inputType ).\nLine: 1\nThe xml was: \n" .
20+
"0:<?xml version=\"1.0\"?>\n1:<config><option name=\"name_one\" label=\"Label One\" renderer=\"one\"/>" .
21+
"</config>\n2:\n"
22+
],
1623
],
1724
'options_node_without_required_attributes' => [
1825
'<?xml version="1.0"?><config><option name="name_one" label="label one"><inputType name="name" label="one"/>' .
1926
'</option><option name="name_two" renderer="renderer"><inputType name="name_two" label="one" /></option>' .
2027
'<option label="label three" renderer="renderer"><inputType name="name_one" label="one"/></option></config>',
2128
[
22-
"Element 'option': The attribute 'renderer' is required but missing.\nLine: 1\n",
23-
"Element 'option': The attribute " . "'label' is required but missing.\nLine: 1\n",
24-
"Element 'option': The attribute 'name' is required but missing.\nLine: 1\n"
29+
"Element 'option': The attribute 'renderer' is required but missing.\nLine: 1\nThe xml was: \n" .
30+
"0:<?xml version=\"1.0\"?>\n1:<config><option name=\"name_one\" label=\"label one\"><inputType " .
31+
"name=\"name\" label=\"one\"/></option><option name=\"name_two\" renderer=\"renderer\"><inputType " .
32+
"name=\"name_two\" label=\"one\"/></option><option label=\"label three\" renderer=\"renderer\">" .
33+
"<inputType name=\"name_one\" label=\"one\"/></option></config>\n2:\n",
34+
"Element 'option': The attribute 'label' is required but missing.\nLine: 1\nThe xml was: \n" .
35+
"0:<?xml version=\"1.0\"?>\n1:<config><option name=\"name_one\" label=\"label one\"><inputType " .
36+
"name=\"name\" label=\"one\"/></option><option name=\"name_two\" renderer=\"renderer\"><inputType " .
37+
"name=\"name_two\" label=\"one\"/></option><option label=\"label three\" renderer=\"renderer\">" .
38+
"<inputType name=\"name_one\" label=\"one\"/></option></config>\n2:\n",
39+
"Element 'option': The attribute 'name' is required but missing.\nLine: 1\nThe xml was: \n" .
40+
"0:<?xml version=\"1.0\"?>\n1:<config><option name=\"name_one\" label=\"label one\"><inputType " .
41+
"name=\"name\" label=\"one\"/></option><option name=\"name_two\" renderer=\"renderer\"><inputType " .
42+
"name=\"name_two\" label=\"one\"/></option><option label=\"label three\" renderer=\"renderer\">" .
43+
"<inputType name=\"name_one\" label=\"one\"/></option></config>\n2:\n"
2544
],
2645
],
2746
'inputType_node_without_required_attributes' => [
2847
'<?xml version="1.0"?><config><option name="name_one" label="label one" renderer="renderer">' .
2948
'<inputType name="name_one"/></option><option name="name_two" renderer="renderer" label="label">' .
3049
'<inputType label="name_two"/></option></config>',
3150
[
32-
"Element 'inputType': The attribute 'label' is required but missing.\nLine: 1\n",
33-
"Element 'inputType': The " . "attribute 'name' is required but missing.\nLine: 1\n"
51+
"Element 'inputType': The attribute 'label' is required but missing.\nLine: 1\nThe xml was: \n" .
52+
"0:<?xml version=\"1.0\"?>\n1:<config><option name=\"name_one\" label=\"label one\" " .
53+
"renderer=\"renderer\"><inputType name=\"name_one\"/></option><option name=\"name_two\" " .
54+
"renderer=\"renderer\" label=\"label\"><inputType label=\"name_two\"/></option></config>\n2:\n",
55+
"Element 'inputType': The attribute 'name' is required but missing.\nLine: 1\nThe xml was: \n" .
56+
"0:<?xml version=\"1.0\"?>\n1:<config><option name=\"name_one\" label=\"label one\" " .
57+
"renderer=\"renderer\"><inputType name=\"name_one\"/></option><option name=\"name_two\" " .
58+
"renderer=\"renderer\" label=\"label\"><inputType label=\"name_two\"/></option></config>\n2:\n"
3459
],
3560
]
3661
];

app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsXmlArray.php

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,59 @@
88
return [
99
'options_node_is_required' => [
1010
'<?xml version="1.0"?><config><inputType name="name_one" /></config>',
11-
["Element 'inputType': This element is not expected. Expected is ( option ).\nLine: 1\n"],
11+
[
12+
"Element 'inputType': This element is not expected. Expected is ( option ).\nLine: 1\n" .
13+
"The xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><inputType name=\"name_one\"/></config>\n2:\n"
14+
],
1215
],
1316
'inputType_node_is_required' => [
1417
'<?xml version="1.0"?><config><option name="name_one"/></config>',
15-
["Element 'option': Missing child element(s). Expected is ( inputType ).\nLine: 1\n"],
18+
[
19+
"Element 'option': Missing child element(s). Expected is ( inputType ).\nLine: 1\n" .
20+
"The xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><option name=\"name_one\"/></config>\n2:\n"
21+
],
1622
],
1723
'options_name_must_be_unique' => [
1824
'<?xml version="1.0"?><config><option name="name_one"><inputType name="name"/>' .
1925
'</option><option name="name_one"><inputType name="name_two"/></option></config>',
2026
[
2127
"Element 'option': Duplicate key-sequence ['name_one'] in unique identity-constraint " .
22-
"'uniqueOptionName'.\nLine: 1\n"
28+
"'uniqueOptionName'.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><option " .
29+
"name=\"name_one\"><inputType name=\"name\"/></option><option name=\"name_one\"><inputType " .
30+
"name=\"name_two\"/></option></config>\n2:\n"
2331
],
2432
],
2533
'inputType_name_must_be_unique' => [
2634
'<?xml version="1.0"?><config><option name="name"><inputType name="name_one"/>' .
2735
'<inputType name="name_one"/></option></config>',
2836
[
2937
"Element 'inputType': Duplicate key-sequence ['name_one'] in unique identity-constraint " .
30-
"'uniqueInputTypeName'.\nLine: 1\n"
38+
"'uniqueInputTypeName'.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n" .
39+
"1:<config><option name=\"name\"><inputType name=\"name_one\"/><inputType name=\"name_one\"/>" .
40+
"</option></config>\n2:\n"
3141
],
3242
],
3343
'renderer_attribute_with_invalid_value' => [
3444
'<?xml version="1.0"?><config><option name="name_one" renderer="123true"><inputType name="name_one"/>' .
3545
'</option></config>',
3646
[
37-
"Element 'option', attribute 'renderer': [facet 'pattern'] The value '123true' is not accepted by the " .
38-
"pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n"
47+
"Element 'option', attribute 'renderer': '123true' is not a valid value of the atomic type 'modelName'.\n" .
48+
"Line: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><option name=\"name_one\" " .
49+
"renderer=\"123true\"><inputType name=\"name_one\"/></option></config>\n2:\n"
3950
],
4051
],
4152
'disabled_attribute_with_invalid_value' => [
4253
'<?xml version="1.0"?><config><option name="name_one"><inputType name="name_one" disabled="7"/>' .
4354
'<inputType name="name_two" disabled="some_string"/></option></config>',
4455
[
45-
"Element 'inputType', attribute 'disabled': '7' is not a valid value of the atomic type" .
46-
" 'xs:boolean'.\nLine: 1\n",
56+
"Element 'inputType', attribute 'disabled': '7' is not a valid value of the atomic type 'xs:boolean'.\n" .
57+
"Line: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><option name=\"name_one\">" .
58+
"<inputType name=\"name_one\" disabled=\"7\"/><inputType name=\"name_two\" disabled=\"some_string\"/>" .
59+
"</option></config>\n2:\n",
4760
"Element 'inputType', attribute 'disabled': 'some_string' is not a valid value of the atomic type " .
48-
"'xs:boolean'.\nLine: 1\n"
61+
"'xs:boolean'.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><option name=\"name_one\">" .
62+
"<inputType name=\"name_one\" disabled=\"7\"/><inputType name=\"name_two\" disabled=\"some_string\"/>" .
63+
"</option></config>\n2:\n"
4964
],
5065
]
5166
];

app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesMergedXmlArray.php

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,55 @@
99
'type_without_required_name' => [
1010
'<?xml version="1.0" encoding="UTF-8"?><config><type label="some label" modelInstance="model_name" /></config>',
1111
[
12-
"Element 'type': The attribute 'name' is required but missing.\nLine: 1\n",
13-
"Element 'type': Not all fields of key identity-constraint 'productTypeKey' evaluate to a node.\nLine: 1\n"
12+
"Element 'type': The attribute 'name' is required but missing.\nLine: 1\nThe xml was: \n" .
13+
"0:<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n1:<config><type label=\"some label\" " .
14+
"modelInstance=\"model_name\"/></config>\n2:\n",
15+
"Element 'type': Not all fields of key identity-constraint 'productTypeKey' evaluate to a node.\n" .
16+
"Line: 1\nThe xml was: \n0:<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n1:<config><type " .
17+
"label=\"some label\" modelInstance=\"model_name\"/></config>\n2:\n"
1418
],
1519
],
1620
'type_without_required_label' => [
1721
'<?xml version="1.0" encoding="UTF-8"?><config><type name="some_name" modelInstance="model_name" /></config>',
18-
["Element 'type': The attribute 'label' is required but missing.\nLine: 1\n"],
22+
[
23+
"Element 'type': The attribute 'label' is required but missing.\nLine: 1\nThe xml was: \n" .
24+
"0:<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n1:<config><type name=\"some_name\" " .
25+
"modelInstance=\"model_name\"/></config>\n2:\n"
26+
],
1927
],
2028
'type_without_required_modelInstance' => [
2129
'<?xml version="1.0" encoding="UTF-8"?><config><type label="some_label" name="some_name" /></config>',
22-
["Element 'type': The attribute 'modelInstance' is required but missing.\nLine: 1\n"],
30+
[
31+
"Element 'type': The attribute 'modelInstance' is required but missing.\nLine: 1\nThe xml was: \n" .
32+
"0:<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n1:<config><type label=\"some_label\" " .
33+
"name=\"some_name\"/></config>\n2:\n"
34+
],
2335
],
2436
'type_pricemodel_without_required_instance_attribute' => [
2537
'<?xml version="1.0" encoding="UTF-8"?><config>' .
2638
'<type label="some_label" name="some_name" modelInstance="model_name"><priceModel/></type></config>',
27-
["Element 'priceModel': The attribute 'instance' is required but missing.\nLine: 1\n"],
39+
[
40+
"Element 'priceModel': The attribute 'instance' is required but missing.\nLine: 1\nThe xml was: \n" .
41+
"0:<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n1:<config><type label=\"some_label\" name=\"some_name\" " .
42+
"modelInstance=\"model_name\"><priceModel/></type></config>\n2:\n"
43+
],
2844
],
2945
'type_indexmodel_without_required_instance_attribute' => [
3046
'<?xml version="1.0" encoding="UTF-8"?><config>' .
3147
'<type label="some_label" name="some_name" modelInstance="model_name"><indexerModel/></type></config>',
32-
["Element 'indexerModel': The attribute 'instance' is required but missing.\nLine: 1\n"],
48+
[
49+
"Element 'indexerModel': The attribute 'instance' is required but missing.\nLine: 1\nThe xml was: \n" .
50+
"0:<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n1:<config><type label=\"some_label\" name=\"some_name\" " .
51+
"modelInstance=\"model_name\"><indexerModel/></type></config>\n2:\n"
52+
],
3353
],
3454
'type_stockindexermodel_without_required_instance_attribute' => [
3555
'<?xml version="1.0" encoding="UTF-8"?><config><type label="some_label" ' .
3656
'name="some_name" modelInstance="model_name"><stockIndexerModel/></type></config>',
37-
["Element 'stockIndexerModel': The attribute 'instance' is required but missing.\nLine: 1\n"],
57+
[
58+
"Element 'stockIndexerModel': The attribute 'instance' is required but missing.\nLine: 1\nThe xml was: \n" .
59+
"0:<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n1:<config><type label=\"some_label\" name=\"some_name\" " .
60+
"modelInstance=\"model_name\"><stockIndexerModel/></type></config>\n2:\n"
61+
],
3862
]
3963
];

0 commit comments

Comments
 (0)