Skip to content

Commit 131f5c6

Browse files
committed
MQE-983: Unit Test for Module Resolver
- Made Module Blacklist Test more Explicit
1 parent 4aab74e commit 131f5c6

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
class ModuleResolverTest extends TestCase
1818
{
19+
private $index = 0;
20+
1921
/**
2022
* remove all registered test doubles
2123
*/
@@ -103,11 +105,26 @@ public function testGetCustomModulePath()
103105
*/
104106
public function testGetModulePathsBlacklist()
105107
{
106-
$this->setMockResolverClass(false, ["Magento_TestModule"], null, null, ['somePath']);
107-
$this->expectOutputString("Excluding module: 0" . PHP_EOL);
108+
$this->setMockResolverClass(
109+
false,
110+
null,
111+
null,
112+
null,
113+
function ($arg1, $arg2) {
114+
if ($arg2 === "") {
115+
$mockValue = ["somePath" => "somePath"];
116+
} elseif (strpos($arg1, "app")) {
117+
$mockValue = ["otherPath" => "otherPath"];
118+
} else {
119+
$mockValue = ["lastPath" => "lastPath"];
120+
}
121+
return $mockValue;
122+
}
123+
);
124+
$this->expectOutputString("Excluding module: somePath" . PHP_EOL);
108125
$resolver = ModuleResolver::getInstance();
109126
$this->setMockResolverProperties($resolver, null, null, ["somePath"]);
110-
$this->assertEquals(['somePath', 'somePath'], $resolver->getModulesPath());
127+
$this->assertEquals(["otherPath", "lastPath"], $resolver->getModulesPath());
111128
}
112129

113130
/**

0 commit comments

Comments
 (0)