Skip to content

Commit 3e083e8

Browse files
authored
Merge pull request #2164 from magento-panda/PANDA-FIXES-2.2
Fixed issues: - MAGETWO-87487 phpunit.xml files should be ignored by Magento/Test/Integrity/Xml/SchemaTest.php
2 parents 36bfa58 + 5316ce4 commit 3e083e8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ public function testXmlFiles()
1414
{
1515
$invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
1616
$invoker(
17-
/**
18-
* @param string $filename
19-
*/
2017
function ($filename) {
2118
$dom = new \DOMDocument();
2219
$xmlFile = file_get_contents($filename);
@@ -27,9 +24,9 @@ function ($filename) {
2724

2825
$schemaLocations = [];
2926
preg_match('/xsi:noNamespaceSchemaLocation=\s*"(urn:[^"]+)"/s', $xmlFile, $schemaLocations);
30-
$this->assertEquals(
27+
$this->assertCount(
3128
2,
32-
count($schemaLocations),
29+
$schemaLocations,
3330
'The XML file at ' . $filename . ' does not have a schema properly defined. It should '
3431
. 'have a xsi:noNamespaceSchemaLocation attribute defined with a URN path. E.g. '
3532
. 'xsi:noNamespaceSchemaLocation="urn:magento:framework:Relative_Path/something.xsd"'
@@ -60,6 +57,7 @@ public function getSchemas()
6057
foreach ($componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $libraryPath) {
6158
$libSchemas = array_merge($libSchemas, $this->_getFiles($libraryPath, '*.xsd'));
6259
}
60+
6361
return $this->_dataSet(array_merge($codeSchemas, $libSchemas));
6462
}
6563

@@ -79,6 +77,7 @@ public function getXmlFiles()
7977
foreach ($componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $libraryPath) {
8078
$libXml = array_merge($libXml, $this->_getFiles($libraryPath, '*.xml', '/.\/Test\/./'));
8179
}
80+
8281
return $this->_dataSet(array_merge($codeXml, $designXml, $libXml));
8382
}
8483

@@ -107,8 +106,11 @@ private function _filterSpecialCases(&$files)
107106
'#conf/schema.xml$#',
108107
'#conf/solrconfig.xml$#',
109108
'#layout/swagger_index_index.xml$#',
110-
'#Doc/etc/doc/vars.xml$#'
109+
'#Doc/etc/doc/vars.xml$#',
110+
'#phpunit.xml$#',
111+
'#app/code/(?!Magento)(.*?)/.*?/Test/.*\.xml$#',
111112
];
113+
112114
foreach ($list as $pattern) {
113115
foreach ($files as $key => $value) {
114116
if (preg_match($pattern, $value)) {
@@ -124,6 +126,7 @@ protected function _dataSet($files)
124126
foreach ($files as $file) {
125127
$data[substr($file, strlen(BP))] = [$file];
126128
}
129+
127130
return $data;
128131
}
129132
}

0 commit comments

Comments
 (0)