20 private static $_classes = [];
28 private static $_fixtureFiles = [];
33 private $componentRegistrar;
59 foreach (glob(
__DIR__ .
'/_files/' . $filePattern) as $file) {
63 str_replace(
BP . DIRECTORY_SEPARATOR,
'', $file)
66 $data = array_merge_recursive(
$data, self::_readList($file));
88 $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
90 foreach (self::$_fixtureFiles as $fixtureFile) {
91 if (array_key_exists($fixtureFile, $testFiles)) {
92 unset($testFiles[$fixtureFile]);
112 foreach (self::$_classes as $restrictedClass => $classRules) {
113 foreach ($classRules[
'exclude'] as $skippedPathInfo) {
114 if (strpos($file, $this->getExcludedFilePath($skippedPathInfo)) === 0) {
120 \
Magento\TestFramework\Utility\CodeCheck::isClassUsed($restrictedClass,
$content),
122 "Class '%s' is restricted in %s. Suggested replacement: %s",
125 $classRules[
'replacement']
137 private function getExcludedFilePath($pathInfo)
139 if ($pathInfo[
'type'] !=
'setup') {
140 return $this->componentRegistrar->getPath($pathInfo[
'type'], $pathInfo[
'name']) .
'/' . $pathInfo[
'path'];
142 return BP .
'/setup/' . $pathInfo[
'path'];
static getPhpFiles($changedFilesList, $fileTypes=0)
defined('TESTS_BP')||define('TESTS_BP' __DIR__
static setUpBeforeClass()
static _loadData(array &$data, $filePattern)
_testRestrictedClasses($file)