Skip to content

Commit c8d9f7f

Browse files
committed
Merge remote-tracking branch 'tier4/ACP2E-3363' into PR-10-04-24
2 parents ca6564a + 29aa694 commit c8d9f7f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
use Magento\Customer\Api\AccountManagementInterface;
1111
use Magento\Customer\Model\AccountManagement;
1212
use Magento\Customer\Model\CustomerRegistry;
13+
use Magento\Framework\App\Area;
1314
use Magento\Framework\App\Http as HttpApp;
1415
use Magento\Framework\App\ObjectManager as AppObjectManager;
1516
use Magento\Framework\App\RequestInterface;
1617
use Magento\Framework\App\Response\Http as HttpResponse;
18+
use Magento\Framework\App\State;
1719
use Magento\Framework\Exception\LocalizedException;
1820
use Magento\Framework\Exception\NoSuchEntityException;
1921
use Magento\Framework\ObjectManagerInterface;
@@ -55,6 +57,16 @@ class GraphQlStateDiff
5557
*/
5658
private readonly Comparator $comparator;
5759

60+
/**
61+
* @var State
62+
*/
63+
private State $appState;
64+
65+
/**
66+
* @var string|null
67+
*/
68+
private ?string $currentArea;
69+
5870
/**
5971
* Constructor
6072
*/
@@ -66,6 +78,9 @@ public function __construct()
6678
AppObjectManager::setInstance($this->objectManagerForTest);
6779
Bootstrap::setObjectManager($this->objectManagerForTest);
6880
$this->comparator = $this->objectManagerForTest->create(Comparator::class);
81+
$this->appState = $this->objectManagerForTest->get(State::class);
82+
$this->currentArea = $this->appState->getAreaCode();
83+
$this->appState->setAreaCode(Area::AREA_GRAPHQL);
6984
$this->objectManagerForTest->_resetState();
7085
}
7186

@@ -86,6 +101,7 @@ public function getTestObjectManager()
86101
*/
87102
public function tearDown(): void
88103
{
104+
$this->appState->setAreaCode($this->currentArea);
89105
$this->objectManagerBeforeTest->getFactory()->setObjectManager($this->objectManagerBeforeTest);
90106
AppObjectManager::setInstance($this->objectManagerBeforeTest);
91107
Bootstrap::setObjectManager($this->objectManagerBeforeTest);

0 commit comments

Comments
 (0)