From d23a26d725c0bf84a0d3a03bc3fe31e7fb7fbcb9 Mon Sep 17 00:00:00 2001 From: Tibor Kotosz Date: Sat, 20 Jun 2020 14:16:16 +0200 Subject: [PATCH] Bugfix: Use the first area as base area (#8) --- .../Listener/MagentoObjectManagerInitializer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bex/Behat/Magento2Extension/Listener/MagentoObjectManagerInitializer.php b/src/Bex/Behat/Magento2Extension/Listener/MagentoObjectManagerInitializer.php index e687632..1f601a0 100644 --- a/src/Bex/Behat/Magento2Extension/Listener/MagentoObjectManagerInitializer.php +++ b/src/Bex/Behat/Magento2Extension/Listener/MagentoObjectManagerInitializer.php @@ -73,7 +73,8 @@ public function initApplication(BeforeSuiteTested $event) $configLoader = $magentoObjectManager->get(ConfigLoaderInterface::class); - $config = $configLoader->load(Area::AREA_GLOBAL); + $mainArea = array_shift($areas); + $config = $configLoader->load($mainArea); foreach ($areas as $area) { $config = array_replace_recursive( $config, @@ -86,9 +87,8 @@ public function initApplication(BeforeSuiteTested $event) $magentoObjectManager->configure($config); - $baseArea = array_shift($areas); $appState = $magentoObjectManager->get(State::class); - $appState->setAreaCode($baseArea); + $appState->setAreaCode($mainArea); // TODO can we remove this? if ($appState->getAreaCode() === Area::AREA_ADMINHTML) {