Skip to content

Commit 395b833

Browse files
author
Willem Wigman
committed
Reinitialize Class Instances so that they pick up config changes
1 parent 58d8234 commit 395b833

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Plugin/CategoryLayoutPlugin.php

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public function afterFetchAvailableFiles(
9090
CategoryInterface $category): array
9191
{
9292
$handles = $this->getLayoutProcessor()->getAvailableHandles();
93-
9493
return array_merge(
9594
$result,
9695
array_filter(

tests/Integration/AbstractFrontendControllerTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ abstract class AbstractFrontendControllerTest extends AbstractController
5959
*/
6060
protected function setUp(): void
6161
{
62-
Bootstrap::getInstance()->reinitialize();
6362
$this->objectManager = Bootstrap::getObjectManager();
6463
$this->layout = $this->objectManager->get(LayoutInterface::class);
6564
$this->configWriter = $this->objectManager->get(Writer::class);
@@ -74,6 +73,10 @@ protected function enableTestModuleInConfig()
7473
{
7574
$this->moduleStatus = $this->objectManager->create(ModuleStatus::class);
7675
$this->moduleStatus->setIsEnabled(true, ['IntegerNet_GlobalCustomLayoutTest']);
76+
77+
$this->objectManager->removeSharedInstance(\Magento\Framework\Module\Manager::class);
78+
$this->objectManager->removeSharedInstance(\Magento\Framework\Module\ModuleList::class);
79+
$this->objectManager->removeSharedInstance(\Magento\Framework\View\Model\Layout\Merge::class);
7780
}
7881

7982
/**

0 commit comments

Comments
 (0)