Skip to content

Commit 1c1e807

Browse files
author
Dale Sikkema
committed
MAGETWO-34867: Process sprint 47 pull request
- update Files utility to reflect 3rd party component tests
1 parent e803308 commit 1c1e807

File tree

1 file changed

+4
-9
lines changed
  • lib/internal/Magento/Framework/App/Utility

1 file changed

+4
-9
lines changed

lib/internal/Magento/Framework/App/Utility/Files.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@ class Files
3737
/** @var string regex for test directories in tools */
3838
protected $toolsTestDirs = '#dev/tools/Magento/Tools/[\\w]+/Test#';
3939

40-
/** @var string regex for test directories in framework */
41-
protected $frameworkTestDirs = '#lib/internal/Magento/Framework/[\\w]+/Test#';
42-
4340
/** @var string regex for test directories in lib/internal */
44-
protected $libTestDirs = '#lib/internal/[\\w]+/[\\w]+/Test#';
41+
protected $libTestDirs = '#lib/internal/[\\w]+/[\\w]+/([\\w]+/)?Test#';
4542

4643
/**
4744
* Setter for an instance of self
@@ -132,12 +129,11 @@ public function getPhpFiles($appCode = true, $otherCode = true, $templates = tru
132129
);
133130
}
134131
if ($otherCode) {
135-
$exclude = [$this->libTestDirs, $this->frameworkTestDirs];
136132
$files = array_merge(
137133
$files,
138134
glob($this->_path . '/*.php', GLOB_NOSORT),
139135
glob($this->_path . '/pub/*.php', GLOB_NOSORT),
140-
$this->getFilesSubset(["{$this->_path}/lib/internal/Magento"], '*.php', $exclude),
136+
$this->getFilesSubset(["{$this->_path}/lib/internal/Magento"], '*.php', $this->libTestDirs),
141137
self::getFiles(["{$this->_path}/dev/tools/Magento/Tools/SampleData"], '*.php')
142138
);
143139
}
@@ -184,7 +180,7 @@ public function getClassFiles(
184180
"{$this->_path}/dev/tests",
185181
"{$this->_path}/app/code/*/*/Test",
186182
"{$this->_path}/lib/internal/*/*/Test",
187-
"{$this->_path}/lib/internal/Magento/Framework/*/Test",
183+
"{$this->_path}/lib/internal/*/*/*/Test",
188184
"{$this->_path}/dev/tools/Magento/Tools/*/Test",
189185
"{$this->_path}/setup/src/Magento/Setup/Test",
190186

@@ -198,10 +194,9 @@ public function getClassFiles(
198194
);
199195
}
200196
if ($lib) {
201-
$exclude = [$this->libTestDirs, $this->frameworkTestDirs];
202197
$files = array_merge(
203198
$files,
204-
$this->getFilesSubset(["{$this->_path}/lib/internal/Magento"], '*.php', $exclude)
199+
$this->getFilesSubset(["{$this->_path}/lib/internal/Magento"], '*.php', $this->libTestDirs)
205200
);
206201
}
207202
self::$_cache[$key] = $files;

0 commit comments

Comments
 (0)