Skip to content

Commit 2ee2266

Browse files
committed
Merge remote-tracking branch 'origin/AC-11633' into Hammer-247-delivery-21Mar24
2 parents ecb3d6c + 697eba0 commit 2ee2266

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ protected function setUp(): void
184184
$this->customOptionFactoryMock
185185
]
186186
];
187-
$this->prepareObjectManager($objects);
187+
$this->objectManager->prepareObjectManager($objects);
188188

189189
$this->helper = $this->objectManager->getObject(
190190
Helper::class,
@@ -772,22 +772,4 @@ private function assembleProductRepositoryMock($links)
772772
->method('getById')
773773
->willReturnMap($repositoryReturnMap);
774774
}
775-
776-
/**
777-
* @param $map
778-
*/
779-
private function prepareObjectManager($map)
780-
{
781-
$objectManagerMock = $this->getMockBuilder(ObjectManagerInterface::class)
782-
->addMethods(['getInstance'])
783-
->onlyMethods(['get'])
784-
->getMockForAbstractClass();
785-
786-
$objectManagerMock->method('getInstance')->willReturnSelf();
787-
$objectManagerMock->method('get')->willReturnMap($map);
788-
789-
$reflectionProperty = new \ReflectionProperty(\Magento\Framework\App\ObjectManager::class, '_instance');
790-
$reflectionProperty->setAccessible(true);
791-
$reflectionProperty->setValue($objectManagerMock);
792-
}
793775
}

dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
7676
$analysisResult->isDefaultLevelUsed(),
7777
$analysisResult->getProjectConfigFile(),
7878
$analysisResult->isResultCacheSaved(),
79-
$analysisResult->getPeakMemoryUsageBytes()
79+
$analysisResult->getPeakMemoryUsageBytes(),
80+
$analysisResult->isResultCacheUsed()
8081
);
8182

8283
return $this->tableErrorFormatter->formatErrors($clearedAnalysisResult, $output);

lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,6 @@ public function prepareObjectManager(array $map = [])
380380

381381
$reflectionProperty = new \ReflectionProperty(AppObjectManager::class, '_instance');
382382
$reflectionProperty->setAccessible(true);
383-
$reflectionProperty->setValue($objectManagerMock);
383+
$reflectionProperty->setValue($objectManagerMock, $objectManagerMock);
384384
}
385385
}

0 commit comments

Comments
 (0)