@@ -14,9 +14,6 @@ public function testXmlFiles()
14
14
{
15
15
$ invoker = new \Magento \Framework \App \Utility \AggregateInvoker ($ this );
16
16
$ invoker (
17
- /**
18
- * @param string $filename
19
- */
20
17
function ($ filename ) {
21
18
$ dom = new \DOMDocument ();
22
19
$ xmlFile = file_get_contents ($ filename );
@@ -27,9 +24,9 @@ function ($filename) {
27
24
28
25
$ schemaLocations = [];
29
26
preg_match ('/xsi:noNamespaceSchemaLocation=\s*"(urn:[^"]+)"/s ' , $ xmlFile , $ schemaLocations );
30
- $ this ->assertEquals (
27
+ $ this ->assertCount (
31
28
2 ,
32
- count ( $ schemaLocations) ,
29
+ $ schemaLocations ,
33
30
'The XML file at ' . $ filename . ' does not have a schema properly defined. It should '
34
31
. 'have a xsi:noNamespaceSchemaLocation attribute defined with a URN path. E.g. '
35
32
. 'xsi:noNamespaceSchemaLocation="urn:magento:framework:Relative_Path/something.xsd" '
@@ -60,6 +57,7 @@ public function getSchemas()
60
57
foreach ($ componentRegistrar ->getPaths (ComponentRegistrar::LIBRARY ) as $ libraryPath ) {
61
58
$ libSchemas = array_merge ($ libSchemas , $ this ->_getFiles ($ libraryPath , '*.xsd ' ));
62
59
}
60
+
63
61
return $ this ->_dataSet (array_merge ($ codeSchemas , $ libSchemas ));
64
62
}
65
63
@@ -79,6 +77,7 @@ public function getXmlFiles()
79
77
foreach ($ componentRegistrar ->getPaths (ComponentRegistrar::LIBRARY ) as $ libraryPath ) {
80
78
$ libXml = array_merge ($ libXml , $ this ->_getFiles ($ libraryPath , '*.xml ' , '/.\/Test\/./ ' ));
81
79
}
80
+
82
81
return $ this ->_dataSet (array_merge ($ codeXml , $ designXml , $ libXml ));
83
82
}
84
83
@@ -107,8 +106,11 @@ private function _filterSpecialCases(&$files)
107
106
'#conf/schema.xml$# ' ,
108
107
'#conf/solrconfig.xml$# ' ,
109
108
'#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$# ' ,
111
112
];
113
+
112
114
foreach ($ list as $ pattern ) {
113
115
foreach ($ files as $ key => $ value ) {
114
116
if (preg_match ($ pattern , $ value )) {
@@ -124,6 +126,7 @@ protected function _dataSet($files)
124
126
foreach ($ files as $ file ) {
125
127
$ data [substr ($ file , strlen (BP ))] = [$ file ];
126
128
}
129
+
127
130
return $ data ;
128
131
}
129
132
}
0 commit comments