Skip to content

Commit 825e8e9

Browse files
authored
MQE-1330: FT can not be executed for bundled extensions
- Removed all trimming of "Magento_" from enabled modules in ModuleResolver - Removed all trimming of "*_" from module name in ModuleResolver
1 parent 8d2b2f5 commit 825e8e9

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

dev/tests/unit/Magento/FunctionalTestFramework/Util/ModuleResolverTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ public function testGetModulePathsAlreadySet()
5757
public function testGetModulePathsAggregate()
5858
{
5959
$this->mockForceGenerate(false);
60-
$this->setMockResolverClass(false, null, null, null, ["example" => "example" . DIRECTORY_SEPARATOR . "paths"]);
60+
$this->setMockResolverClass(
61+
false,
62+
null,
63+
null,
64+
null,
65+
["Magento_example" => "example" . DIRECTORY_SEPARATOR . "paths"]
66+
);
6167
$resolver = ModuleResolver::getInstance();
6268
$this->setMockResolverProperties($resolver, null, [0 => "Magento_example"]);
6369
$this->assertEquals(
@@ -79,7 +85,7 @@ public function testGetModulePathsLocations()
7985
$this->mockForceGenerate(false);
8086
$mockResolver = $this->setMockResolverClass(
8187
true,
82-
[0 => "magento_example"],
88+
[0 => "example"],
8389
null,
8490
null,
8591
["example" => "example" . DIRECTORY_SEPARATOR . "paths"]

src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ class ModuleResolver
3838
*/
3939
const REGISTRAR_CLASS = "\Magento\Framework\Component\ComponentRegistrar";
4040

41-
/**
42-
* Magento Directory Structure Name Prefix
43-
*/
44-
const MAGENTO_PREFIX = "Magento_";
45-
4641
/**
4742
* Enabled modules.
4843
*
@@ -278,7 +273,6 @@ private function globRelevantPaths($testPath, $pattern)
278273

279274
foreach ($relevantPaths as $codePath) {
280275
$mainModName = array_search($codePath, $allComponents) ?: basename(str_replace($pattern, '', $codePath));
281-
$mainModName = str_replace(self::MAGENTO_PREFIX, "", $mainModName);
282276
$modulePaths[$mainModName][] = $codePath;
283277

284278
if (MftfApplicationConfig::getConfig()->verboseEnabled()) {
@@ -340,17 +334,16 @@ private function getEnabledDirectoryPaths($enabledModules, $allModulePaths)
340334
{
341335
$enabledDirectoryPaths = [];
342336
foreach ($enabledModules as $magentoModuleName) {
343-
// Magento_Backend -> Backend or DevDocs -> DevDocs (if whitelisted has no underscore)
344-
$moduleShortName = explode('_', $magentoModuleName)[1] ?? $magentoModuleName;
345-
if (!isset($this->knownDirectories[$moduleShortName]) && !isset($allModulePaths[$moduleShortName])) {
337+
if (!isset($this->knownDirectories[$magentoModuleName]) && !isset($allModulePaths[$magentoModuleName])) {
346338
continue;
347-
} elseif (isset($this->knownDirectories[$moduleShortName]) && !isset($allModulePaths[$moduleShortName])) {
339+
} elseif (isset($this->knownDirectories[$magentoModuleName])
340+
&& !isset($allModulePaths[$magentoModuleName])) {
348341
LoggingUtil::getInstance()->getLogger(ModuleResolver::class)->warn(
349342
"Known directory could not match to an existing path.",
350-
['knownDirectory' => $moduleShortName]
343+
['knownDirectory' => $magentoModuleName]
351344
);
352345
} else {
353-
$enabledDirectoryPaths[$moduleShortName] = $allModulePaths[$moduleShortName];
346+
$enabledDirectoryPaths[$magentoModuleName] = $allModulePaths[$magentoModuleName];
354347
}
355348
}
356349
return $enabledDirectoryPaths;

0 commit comments

Comments
 (0)