Skip to content

Commit caa283c

Browse files
committed
33308: Fixed code after review
1 parent 3330a67 commit caa283c

File tree

1 file changed

+5
-58
lines changed

1 file changed

+5
-58
lines changed

src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php

+5-58
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ public function getEnabledModules()
214214
*
215215
* @param boolean $verbosePath
216216
* @return array
217+
* @throws TestFrameworkException
217218
*/
218219
public function getModulesPath($verbosePath = false)
219220
{
@@ -226,7 +227,7 @@ public function getModulesPath($verbosePath = false)
226227
}
227228

228229
// Find test modules paths by searching patterns (Test/Mftf, etc)
229-
$allModulePaths = $this->aggregateTestModulePaths();
230+
$allModulePaths = ModuleResolverService::getInstance()->aggregateTestModulePaths();
230231

231232
// Find test modules paths by searching test composer.json files
232233
$composerBasedModulePaths = $this->aggregateTestModulePathsFromComposerJson();
@@ -282,17 +283,6 @@ protected function getModuleAllowlist()
282283
return array_map('trim', explode(',', $moduleAllowlist));
283284
}
284285

285-
/**
286-
* Retrieves all module directories which might contain pertinent test code.
287-
*
288-
* @return array
289-
* @throws TestFrameworkException
290-
*/
291-
private function aggregateTestModulePaths()
292-
{
293-
return ModuleResolverService::getInstance()->aggregateTestModulePaths();
294-
}
295-
296286
/**
297287
* Aggregate all code paths with test module composer json files
298288
*
@@ -317,18 +307,7 @@ private function aggregateTestModulePathsFromComposerJson()
317307
$searchCodePaths[] = $modulePath;
318308
}
319309

320-
return $this->getComposerJsonTestModulePaths($searchCodePaths);
321-
}
322-
323-
/**
324-
* Retrieve all module code paths that have test module composer json files
325-
*
326-
* @param array $codePaths
327-
* @return array
328-
*/
329-
private function getComposerJsonTestModulePaths($codePaths)
330-
{
331-
return ModuleResolverService::getInstance()->getComposerJsonTestModulePaths($codePaths);
310+
return ModuleResolverService::getInstance()->getComposerJsonTestModulePaths($searchCodePaths);
332311
}
333312

334313
/**
@@ -342,18 +321,6 @@ private function aggregateTestModulePathsFromComposerInstaller()
342321
$magentoBaseCodePath = MAGENTO_BP;
343322
$composerFile = $magentoBaseCodePath . DIRECTORY_SEPARATOR . 'composer.json';
344323

345-
return $this->getComposerInstalledTestModulePaths($composerFile);
346-
}
347-
348-
/**
349-
* Retrieve composer installed test module code paths
350-
*
351-
* @param string $composerFile
352-
*
353-
* @return array
354-
*/
355-
private function getComposerInstalledTestModulePaths($composerFile)
356-
{
357324
return ModuleResolverService::getInstance()->getComposerInstalledTestModulePaths($composerFile);
358325
}
359326

@@ -495,7 +462,7 @@ private function mergeModulePaths($oneToOneArray, $oneToManyArray)
495462
*/
496463
private function normalizeModuleNames($codePaths)
497464
{
498-
$allComponents = $this->getRegisteredModuleList();
465+
$allComponents = ModuleResolverService::getInstance()->getRegisteredModuleList();
499466
if (empty($allComponents)) {
500467
return $codePaths;
501468
}
@@ -571,7 +538,7 @@ private function printMagentoVersionInfo()
571538
protected function applyCustomModuleMethods($modulesPath)
572539
{
573540
$modulePathsResult = $this->removeBlocklistModules($modulesPath);
574-
$customModulePaths = $this->getCustomModulePaths();
541+
$customModulePaths = ModuleResolverService::getInstance()->getCustomModulePaths();
575542

576543
array_map(function ($key, $value) {
577544
LoggingUtil::getInstance()->getLogger(ModuleResolver::class)->info(
@@ -609,16 +576,6 @@ private function removeBlocklistModules($modulePaths)
609576
return $modulePathsResult;
610577
}
611578

612-
/**
613-
* Returns an array of custom module paths defined by the user
614-
*
615-
* @return string[]
616-
*/
617-
private function getCustomModulePaths()
618-
{
619-
return ModuleResolverService::getInstance()->getCustomModulePaths();
620-
}
621-
622579
/**
623580
* Getter for moduleBlocklist.
624581
*
@@ -629,16 +586,6 @@ private function getModuleBlocklist()
629586
return $this->moduleBlocklist;
630587
}
631588

632-
/**
633-
* Calls Magento method for determining registered modules.
634-
*
635-
* @return string[]
636-
*/
637-
private function getRegisteredModuleList()
638-
{
639-
return ModuleResolverService::getInstance()->getRegisteredModuleList();
640-
}
641-
642589
/**
643590
* Find vendor and module name from path
644591
*

0 commit comments

Comments
 (0)