Skip to content

Commit 5ac6b56

Browse files
committed
MQE-1124: [Github Issue] Allow running tests for modules installed in Magento instance via vendor directory. #162
- Reintroduced recursive_merge to prevent similar directories with different contents being missed
1 parent 1983538 commit 5ac6b56

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public function testGetModulePathsAggregate()
6262
$this->setMockResolverProperties($resolver, null, [0 => "Magento_example"]);
6363
$this->assertEquals(
6464
[
65+
"example" . DIRECTORY_SEPARATOR . "paths",
66+
"example" . DIRECTORY_SEPARATOR . "paths",
6567
"example" . DIRECTORY_SEPARATOR . "paths"
6668
],
6769
$resolver->getModulesPath()
@@ -86,6 +88,8 @@ public function testGetModulePathsLocations()
8688
$this->setMockResolverProperties($resolver, null, null);
8789
$this->assertEquals(
8890
[
91+
"example" . DIRECTORY_SEPARATOR . "paths",
92+
"example" . DIRECTORY_SEPARATOR . "paths",
8993
"example" . DIRECTORY_SEPARATOR . "paths"
9094
],
9195
$resolver->getModulesPath()
@@ -150,7 +154,7 @@ function ($arg1, $arg2) {
150154
);
151155
$resolver = ModuleResolver::getInstance();
152156
$this->setMockResolverProperties($resolver, null, null, ["somePath"]);
153-
$this->assertEquals(["lastPath"], $resolver->getModulesPath());
157+
$this->assertEquals(["lastPath", "lastPath"], $resolver->getModulesPath());
154158
TestLoggingUtil::getInstance()->validateMockLogStatement(
155159
'info',
156160
'excluding module',

src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ private function aggregateTestModulePaths()
235235
];
236236

237237
foreach ($codePathsToPattern as $codePath => $pattern) {
238-
$allModulePaths = array_merge($allModulePaths, $this->globRelevantPaths($codePath, $pattern));
238+
$allModulePaths = array_merge_recursive($allModulePaths, $this->globRelevantPaths($codePath, $pattern));
239239
}
240240

241241
return $allModulePaths;
@@ -289,7 +289,7 @@ private static function globRelevantWrapper($testPath, $pattern)
289289
$subDirectory = "*" . DIRECTORY_SEPARATOR;
290290
$directories = glob($testPath . $subDirectory . $pattern, GLOB_ONLYDIR);
291291
foreach (glob($testPath . $subDirectory, GLOB_ONLYDIR) as $dir) {
292-
$directories = array_merge($directories, self::globRelevantWrapper($dir, $pattern));
292+
$directories = array_merge_recursive($directories, self::globRelevantWrapper($dir, $pattern));
293293
}
294294
return $directories;
295295
}

0 commit comments

Comments
 (0)