@@ -82,7 +82,7 @@ function ($file) {
82
82
protected function _collectResourceHelpersPhp ($ contents , &$ classes )
83
83
{
84
84
$ regex = '/(?:\:\:|\->)getResourceHelper\(\s* \'([a-z\d \\\\]+) \'\s*\)/ix ' ;
85
- $ matches = \Magento \Framework \Test \Utility \Classes::getAllMatches ($ contents , $ regex );
85
+ $ matches = \Magento \Framework \App \Utility \Classes::getAllMatches ($ contents , $ regex );
86
86
foreach ($ matches as $ moduleName ) {
87
87
$ classes [] = "{$ moduleName }\\Model \\Resource \\Helper \\Mysql4 " ;
88
88
}
@@ -96,10 +96,10 @@ public function testConfigFiles()
96
96
* @param string $path
97
97
*/
98
98
function ($ path ) {
99
- $ classes = \Magento \Framework \Test \Utility \Classes::collectClassesInConfig (simplexml_load_file ($ path ));
99
+ $ classes = \Magento \Framework \App \Utility \Classes::collectClassesInConfig (simplexml_load_file ($ path ));
100
100
$ this ->_assertClassesExist ($ classes , $ path );
101
101
},
102
- \Magento \Framework \Test \Utility \Files::init ()->getMainConfigFiles ()
102
+ \Magento \Framework \App \Utility \Files::init ()->getMainConfigFiles ()
103
103
);
104
104
}
105
105
@@ -113,30 +113,30 @@ public function testLayoutFiles()
113
113
function ($ path ) {
114
114
$ xml = simplexml_load_file ($ path );
115
115
116
- $ classes = \Magento \Framework \Test \Utility \Classes::getXmlNodeValues (
116
+ $ classes = \Magento \Framework \App \Utility \Classes::getXmlNodeValues (
117
117
$ xml ,
118
118
'/layout//*[contains(text(), " \\\\Block \\\\") or contains(text(),
119
119
" \\\\Model \\\\") or contains(text(), " \\\\Helper \\\\")] '
120
120
);
121
- foreach (\Magento \Framework \Test \Utility \Classes::getXmlAttributeValues (
121
+ foreach (\Magento \Framework \App \Utility \Classes::getXmlAttributeValues (
122
122
$ xml ,
123
123
'/layout//@helper ' ,
124
124
'helper '
125
125
) as $ class ) {
126
- $ classes [] = \Magento \Framework \Test \Utility \Classes::getCallbackClass ($ class );
126
+ $ classes [] = \Magento \Framework \App \Utility \Classes::getCallbackClass ($ class );
127
127
}
128
- foreach (\Magento \Framework \Test \Utility \Classes::getXmlAttributeValues (
128
+ foreach (\Magento \Framework \App \Utility \Classes::getXmlAttributeValues (
129
129
$ xml ,
130
130
'/layout//@module ' ,
131
131
'module '
132
132
) as $ module ) {
133
133
$ classes [] = str_replace ('_ ' , '\\' , "{$ module }_Helper_Data " );
134
134
}
135
- $ classes = array_merge ($ classes , \Magento \Framework \Test \Utility \Classes::collectLayoutClasses ($ xml ));
135
+ $ classes = array_merge ($ classes , \Magento \Framework \App \Utility \Classes::collectLayoutClasses ($ xml ));
136
136
137
137
$ this ->_assertClassesExist (array_unique ($ classes ), $ path );
138
138
},
139
- \Magento \Framework \Test \Utility \Files::init ()->getLayoutFiles ()
139
+ \Magento \Framework \App \Utility \Files::init ()->getLayoutFiles ()
140
140
);
141
141
}
142
142
@@ -166,11 +166,11 @@ protected function _assertClassesExist($classes, $path)
166
166
$ this ->assertTrue (
167
167
isset (
168
168
self ::$ _existingClasses [$ class ]
169
- ) || \Magento \Framework \Test \Utility \Files::init ()->classFileExists (
169
+ ) || \Magento \Framework \App \Utility \Files::init ()->classFileExists (
170
170
$ class
171
- ) || \Magento \Framework \Test \Utility \Classes::isVirtual (
171
+ ) || \Magento \Framework \App \Utility \Classes::isVirtual (
172
172
$ class
173
- ) || \Magento \Framework \Test \Utility \Classes::isAutogenerated (
173
+ ) || \Magento \Framework \App \Utility \Classes::isAutogenerated (
174
174
$ class
175
175
)
176
176
);
@@ -199,7 +199,7 @@ public function testClassNamespaces()
199
199
*/
200
200
function ($ file ) {
201
201
$ relativePath = str_replace (
202
- \Magento \Framework \Test \Utility \Files::init ()->getPathToSource () . "/ " ,
202
+ \Magento \Framework \App \Utility \Files::init ()->getPathToSource () . "/ " ,
203
203
"" ,
204
204
$ file
205
205
);
@@ -225,7 +225,7 @@ function ($file) {
225
225
$ className = array_pop ($ classParts );
226
226
$ this ->_assertClassNamespace ($ file , $ relativePath , $ contents , $ className );
227
227
},
228
- \Magento \Framework \Test \Utility \Files::init ()->getClassFiles ()
228
+ \Magento \Framework \App \Utility \Files::init ()->getClassFiles ()
229
229
);
230
230
}
231
231
@@ -236,11 +236,11 @@ protected function _setNamespaceBlackList()
236
236
foreach (glob (__DIR__ . '/_files/blacklist/namespace.txt ' ) as $ list ) {
237
237
$ fileList = file ($ list , FILE_IGNORE_NEW_LINES );
238
238
foreach ($ fileList as $ currentFile ) {
239
- $ absolutePath = \Magento \Framework \Test \Utility \Files::init ()->getPathToSource () .
239
+ $ absolutePath = \Magento \Framework \App \Utility \Files::init ()->getPathToSource () .
240
240
'/ ' .
241
241
$ currentFile ;
242
242
if (is_dir ($ absolutePath )) {
243
- $ recursiveFiles = \Magento \Framework \Test \Utility \Files::getFiles (
243
+ $ recursiveFiles = \Magento \Framework \App \Utility \Files::getFiles (
244
244
[$ absolutePath ],
245
245
'*.php ' ,
246
246
true
@@ -308,7 +308,7 @@ public function testClassReferences()
308
308
*/
309
309
function ($ file ) {
310
310
$ relativePath = str_replace (
311
- \Magento \Framework \Test \Utility \Files::init ()->getPathToSource (),
311
+ \Magento \Framework \App \Utility \Files::init ()->getPathToSource (),
312
312
"" ,
313
313
$ file
314
314
);
@@ -390,7 +390,7 @@ function ($file) {
390
390
$ badClasses = $ this ->removeSpecialCases ($ badClasses , $ file , $ contents , $ namespacePath );
391
391
$ this ->_assertClassReferences ($ badClasses , $ file );
392
392
},
393
- \Magento \Framework \Test \Utility \Files::init ()->getClassFiles ()
393
+ \Magento \Framework \App \Utility \Files::init ()->getClassFiles ()
394
394
);
395
395
}
396
396
@@ -479,13 +479,11 @@ protected function removeSpecialCases($badClasses, $file, $contents, $namespaceP
479
479
'/dev/tests/performance/framework/ ' ,
480
480
'/dev/tests/static/framework/ ' ,
481
481
'/dev/tests/static/testsuite/ ' ,
482
- '/dev/tests/unit/framework/ ' ,
483
- '/dev/tests/unit/testsuite/ ' ,
484
482
'/setup/src/ ' ,
485
483
];
486
484
// Full list of directories where there may be namespace classes
487
485
foreach ($ directories as $ directory ) {
488
- $ fullPath = \Magento \Framework \Test \Utility \Files::init ()->getPathToSource () .
486
+ $ fullPath = \Magento \Framework \App \Utility \Files::init ()->getPathToSource () .
489
487
$ directory .
490
488
$ namespacePath .
491
489
'/ ' .
@@ -530,7 +528,7 @@ protected function _assertClassReferences($badClasses, $file)
530
528
531
529
public function testCoversAnnotation ()
532
530
{
533
- $ files = \Magento \Framework \Test \Utility \Files::init ();
531
+ $ files = \Magento \Framework \App \Utility \Files::init ();
534
532
$ errors = [];
535
533
foreach ($ files ->getFiles ([BP . '/dev/tests/{integration,unit} ' ], '* ' ) as $ file ) {
536
534
$ code = file_get_contents ($ file );
0 commit comments