Skip to content

Commit f43fe34

Browse files
committed
ACP2E-3631: Adobe Commerce 2.4.7-p3 unit tests are failing
1 parent b260899 commit f43fe34

File tree

9 files changed

+44
-35
lines changed

9 files changed

+44
-35
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedErr
5252
$this->assertMatchesRegularExpression($error, $actualError);
5353
$matched = true;
5454
break;
55-
} catch (AssertionFailedError $e) {}
55+
} catch (AssertionFailedError $e) {
56+
}
5657
}
5758
$this->assertTrue($matched, "None of the errors matched: $error");
5859
} else {

app/code/Magento/Config/Test/Unit/Model/Config/_files/invalidSystemXmlArray.php

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
'</tab><tab id="tab1"><label>Label Two</label></tab></system></config>',
1212
[
1313
[
14-
"Element 'tab': Duplicate key-sequence ['tab1'] in unique identity-constraint 'uniqueTabId'.\nLine: 1\n" .
15-
"The xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system><tab id=\"tab1\"><label>Label One</label>" .
16-
"</tab><tab id=\"tab1\"><label>Label Two</label></tab></system></config>\n2:\n",
14+
"Element 'tab': Duplicate key-sequence ['tab1'] in unique identity-constraint 'uniqueTabId'.\n" .
15+
"Line: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system><tab id=\"tab1\"><label>" .
16+
"Label One</label></tab><tab id=\"tab1\"><label>Label Two</label></tab></system></config>\n2:\n",
1717
false,
1818
],
1919
],
@@ -37,10 +37,10 @@
3737
'<group id="group2"><label>Label_One</label></group></section></system></config>',
3838
[
3939
[
40-
"Element 'field': Duplicate key-sequence ['field_id'] in unique identity-constraint 'uniqueFieldId'.\n" .
41-
"Line: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system><section id=\"section1\"><group " .
42-
"id=\"group1\"><label>Label</label><field id=\"field_id\"/><field id=\"field_id\"/></group><group " .
43-
"id=\"group2\"><label>Label_One</label></group></section></system></config>\n2:\n",
40+
"Element 'field': Duplicate key-sequence ['field_id'] in unique identity-constraint 'uniqueFieldId'." .
41+
"\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system><section id=\"section1\">" .
42+
"<group id=\"group1\"><label>Label</label><field id=\"field_id\"/><field id=\"field_id\"/></group>" .
43+
"<group id=\"group2\"><label>Label_One</label></group></section></system></config>\n2:\n",
4444
false,
4545
],
4646
],
@@ -64,8 +64,8 @@
6464
[
6565
[
6666
"Element 'group': Duplicate key-sequence ['group1'] in unique identity-constraint 'uniqueGroupId'.\n" .
67-
"Line: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system><section id=\"section1\"><group " .
68-
"id=\"group1\"><label>Label</label></group><group id=\"group1\"><label>Label_One</label>" .
67+
"Line: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system><section id=\"section1\">" .
68+
"<group id=\"group1\"><label>Label</label></group><group id=\"group1\"><label>Label_One</label>" .
6969
"</group></section></system></config>\n2:\n",
7070
false,
7171
],
@@ -77,9 +77,9 @@
7777
[
7878
[
7979
"Element 'group': This element is not expected. Expected is one of ( tab, section ).\nLine: 1\n" .
80-
"The xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system><group id=\"group1\"><label>Label</label>" .
81-
"<tab>Tab</tab></group><group id=\"group1\"><label>Label_One</label><tab>Tab_One</tab></group></system>" .
82-
"</config>\n2:\n",
80+
"The xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system><group id=\"group1\"><label>Label" .
81+
"</label><tab>Tab</tab></group><group id=\"group1\"><label>Label_One</label><tab>Tab_One</tab>" .
82+
"</group></system></config>\n2:\n",
8383
false,
8484
],
8585
],
@@ -91,11 +91,11 @@
9191
'<group id="group2"><label>Label_One</label></group></section></system></config>',
9292
[
9393
[
94-
"Element 'upload_dir': This element is not expected.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n" .
95-
"1:<config><system><section id=\"section1\"><group id=\"group1\"><label>Label</label><field " .
96-
"id=\"field_id\"/><upload_dir config=\"node_one/node_two/node_three\" scope_info=\"1\">" .
97-
"node_one/node_two/node_three</upload_dir></group><group id=\"group2\"><label>Label_One" .
98-
"</label></group></section></system></config>\n2:\n",
94+
"Element 'upload_dir': This element is not expected.\nLine: 1\nThe xml was: \n0:" .
95+
"<?xml version=\"1.0\"?>\n1:<config><system><section id=\"section1\"><group id=\"group1\">" .
96+
"<label>Label</label><field id=\"field_id\"/><upload_dir config=\"node_one/node_two/node_three\" " .
97+
"scope_info=\"1\">node_one/node_two/node_three</upload_dir></group><group id=\"group2\">" .
98+
"<label>Label_One</label></group></section></system></config>\n2:\n",
9999
false,
100100
],
101101
],
@@ -154,16 +154,16 @@
154154
false,
155155
],
156156
[
157-
"Element 'field', attribute 'id': [facet 'minLength'] The value 'f' has a length of '1'; this underruns " .
158-
"the allowed minimum length of '2'.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n" .
157+
"Element 'field', attribute 'id': [facet 'minLength'] The value 'f' has a length of '1'; this " .
158+
"underruns the allowed minimum length of '2'.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n" .
159159
"1:<config><system><section id=\"s\"><group id=\"gr\"><label>Label</label><field id=\"f\"/></group>" .
160160
"<group id=\"group1\"><label>Label</label></group></section><tab id=\"h\"><label>Label_One</label>" .
161161
"</tab></system></config>\n2:\n",
162162
false,
163163
],
164164
[
165-
"Element 'tab', attribute 'id': [facet 'minLength'] The value 'h' has a length of '1'; this underruns " .
166-
"the allowed minimum length of '2'.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n" .
165+
"Element 'tab', attribute 'id': [facet 'minLength'] The value 'h' has a length of '1'; this " .
166+
"underruns the allowed minimum length of '2'.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n" .
167167
"1:<config><system><section id=\"s\"><group id=\"gr\"><label>Label</label><field id=\"f\"/></group>" .
168168
"<group id=\"group1\"><label>Label</label></group></section><tab id=\"h\"><label>Label_One</label>" .
169169
"</tab></system></config>\n2:\n",
@@ -233,8 +233,9 @@
233233
[
234234
"Element 'section', attribute 'advanced': 'string' is not a valid value of the atomic type " .
235235
"'xs:boolean'.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system><section " .
236-
"id=\"section1\" advanced=\"string\"><group id=\"group1\"><label>Label</label><field id=\"field_id\"/>" .
237-
"</group><group id=\"group2\"><label>Label_One</label></group></section></system></config>\n2:\n",
236+
"id=\"section1\" advanced=\"string\"><group id=\"group1\"><label>Label</label>" .
237+
"<field id=\"field_id\"/></group><group id=\"group2\"><label>Label_One</label></group></section>" .
238+
"</system></config>\n2:\n",
238239
false,
239240
],
240241
],
@@ -339,10 +340,10 @@
339340
[
340341
[
341342
"Element 'attribute': Duplicate key-sequence ['one'] in unique identity-constraint " .
342-
"'uniqueAttributeType'.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system><section " .
343-
"id=\"name\"><group id=\"name\"><label>Label</label><field id=\"name\"><attribute type=\"one\"/>" .
344-
"<attribute type=\"one\"/></field></group><group id=\"group2\"><label>Label_One</label></group></section>" .
345-
"</system></config>\n2:\n",
343+
"'uniqueAttributeType'.\nLine: 1\nThe xml was: \n0:<?xml version=\"1.0\"?>\n1:<config><system>" .
344+
"<section id=\"name\"><group id=\"name\"><label>Label</label><field id=\"name\">" .
345+
"<attribute type=\"one\"/><attribute type=\"one\"/></field></group><group id=\"group2\">" .
346+
"<label>Label_One</label></group></section></system></config>\n2:\n",
346347
false,
347348
],
348349
],

app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ protected function _testXmlAgainstXsd($fixtureXml, $schemaFile, array $expectedE
224224
$this->assertMatchesRegularExpression($error, $actualError);
225225
$matched = true;
226226
break;
227-
} catch (AssertionFailedError $e) {}
227+
} catch (AssertionFailedError $e) {
228+
}
228229
}
229230
$this->assertTrue($matched, "None of the errors matched: $error");
230231
} else {

app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/XsdTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public function testSchemaCorrectlyIdentifiesInvalidProductOptionsXml($xmlString
6666
$this->assertMatchesRegularExpression($error, $actualError);
6767
$matched = true;
6868
break;
69-
} catch (AssertionFailedError $e) {}
69+
} catch (AssertionFailedError $e) {
70+
}
7071
}
7172
$this->assertTrue($matched, "None of the errors matched: $error");
7273
} else {

app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdMergedTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedErr
5252
$this->assertMatchesRegularExpression($error, $actualError);
5353
$matched = true;
5454
break;
55-
} catch (AssertionFailedError $e) {}
55+
} catch (AssertionFailedError $e) {
56+
}
5657
}
5758
$this->assertTrue($matched, "None of the errors matched: $error");
5859
} else {

app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedErr
5252
$this->assertMatchesRegularExpression($error, $actualError);
5353
$matched = true;
5454
break;
55-
} catch (AssertionFailedError $e) {}
55+
} catch (AssertionFailedError $e) {
56+
}
5657
}
5758
$this->assertTrue($matched, "None of the errors matched: $error");
5859
} else {

lib/internal/Magento/Framework/Indexer/Test/Unit/XsdTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedErr
6060
$this->assertMatchesRegularExpression($error, $actualError);
6161
$matched = true;
6262
break;
63-
} catch (AssertionFailedError $e) {}
63+
} catch (AssertionFailedError $e) {
64+
}
6465
}
6566
$this->assertTrue($matched, "None of the errors matched: $error");
6667
} else {

lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/XsdTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedErr
5757
$this->assertMatchesRegularExpression($error, $actualError);
5858
$matched = true;
5959
break;
60-
} catch (AssertionFailedError $e) {}
60+
} catch (AssertionFailedError $e) {
61+
}
6162
}
6263
$this->assertTrue($matched, "None of the errors matched: $error");
6364
} else {

lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/invalidConfigXmlArray.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@
336336
</config>',
337337
[
338338
[
339-
"/Element \'virtualType\', attribute \'name\': .*\'777Digits\\\\IsNotAllowed\' is not (a valid value|accepted).*/",
339+
"/Element \'virtualType\', attribute \'name\': .*\'777Digits\\\\IsNotAllowed\' is not" .
340+
" (a valid value|accepted).*/",
340341
true,
341342
],
342343
],

0 commit comments

Comments
 (0)