File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
dev/tests/integration/testsuite/Magento/GraphQl/App/State Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,16 @@ class GraphQlStateDiff
5757 */
5858 private readonly Comparator $ comparator ;
5959
60+ /**
61+ * @var State
62+ */
63+ private State $ appState ;
64+
65+ /**
66+ * @var string
67+ */
68+ private string $ currentArea ;
69+
6070 /**
6171 * Constructor
6272 */
@@ -68,7 +78,9 @@ public function __construct()
6878 AppObjectManager::setInstance ($ this ->objectManagerForTest );
6979 Bootstrap::setObjectManager ($ this ->objectManagerForTest );
7080 $ this ->comparator = $ this ->objectManagerForTest ->create (Comparator::class);
71- $ this ->objectManagerForTest ->get (State::class)->setAreaCode (Area::AREA_GRAPHQL );
81+ $ this ->appState = $ this ->objectManagerForTest ->get (State::class);
82+ $ this ->currentArea = $ this ->appState ->getAreaCode ();
83+ $ this ->appState ->setAreaCode (Area::AREA_GRAPHQL );
7284 $ this ->objectManagerForTest ->_resetState ();
7385 }
7486
@@ -89,6 +101,7 @@ public function getTestObjectManager()
89101 */
90102 public function tearDown (): void
91103 {
104+ $ this ->appState ->setAreaCode ($ this ->currentArea );
92105 $ this ->objectManagerBeforeTest ->getFactory ()->setObjectManager ($ this ->objectManagerBeforeTest );
93106 AppObjectManager::setInstance ($ this ->objectManagerBeforeTest );
94107 Bootstrap::setObjectManager ($ this ->objectManagerBeforeTest );
You can’t perform that action at this time.
0 commit comments