We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 768261d commit ab85062Copy full SHA for ab85062
lib/internal/Magento/Framework/TestFramework/Unit/Listener/ReplaceObjectManager.php
@@ -32,6 +32,13 @@ public function startTest(\PHPUnit_Framework_Test $test)
32
if ($test instanceof \PHPUnit_Framework_TestCase) {
33
$objectManagerMock = $test->getMockBuilder(ObjectManagerInterface::class)
34
->getMockForAbstractClass();
35
+ $createMockCallback = function ($type) use ($test) {
36
+ return $test->getMockBuilder($type)
37
+ ->disableOriginalConstructor()
38
+ ->getMockForAbstractClass();
39
+ };
40
+ $objectManagerMock->method('create')->willReturnCallback($createMockCallback);
41
+ $objectManagerMock->method('get')->willReturnCallback($createMockCallback);
42
ObjectManager::setInstance($objectManagerMock);
43
}
44
0 commit comments