Skip to content

Commit d3c9bb8

Browse files
committed
ACP2E-3324: fix integration error
1 parent f90a6a1 commit d3c9bb8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/code/Magento/Theme/Test/Fixture/DesignConfig.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
namespace Magento\Theme\Test\Fixture;
2020

21+
use Magento\Framework\App\State;
2122
use Magento\Framework\DataObject;
2223
use Magento\Framework\DataObjectFactory;
2324
use Magento\Store\Model\ScopeInterface;
@@ -62,10 +63,12 @@ class DesignConfig implements RevertibleDataFixtureInterface
6263
/**
6364
* @param DesignConfigRepositoryInterface $designConfigRepository
6465
* @param DataObjectFactory $dataObjectFactory
66+
* @param State $state
6567
*/
6668
public function __construct(
6769
private readonly DesignConfigRepositoryInterface $designConfigRepository,
6870
private readonly DataObjectFactory $dataObjectFactory,
71+
private readonly State $state
6972
) {
7073
}
7174

@@ -117,9 +120,12 @@ private function applyConfig(string $scopeType, int $scopeId, array $data): arra
117120
$fieldData->setValue($data[$fieldData->getPath()]);
118121
}
119122
}
123+
$currentArea = $this->state->getAreaCode();
124+
$this->state->setAreaCode('adminhtml');
120125
$designConfig->setScope($scopeType);
121126
$designConfig->setScopeId($scopeId);
122127
$this->designConfigRepository->save($designConfig);
128+
$this->state->setAreaCode($currentArea);
123129
return $origData;
124130
}
125131
}

0 commit comments

Comments
 (0)