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
57
57
*/
58
58
private readonly Comparator $ comparator ;
59
59
60
+ /**
61
+ * @var State
62
+ */
63
+ private State $ appState ;
64
+
65
+ /**
66
+ * @var string
67
+ */
68
+ private string $ currentArea ;
69
+
60
70
/**
61
71
* Constructor
62
72
*/
@@ -68,7 +78,9 @@ public function __construct()
68
78
AppObjectManager::setInstance ($ this ->objectManagerForTest );
69
79
Bootstrap::setObjectManager ($ this ->objectManagerForTest );
70
80
$ 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 );
72
84
$ this ->objectManagerForTest ->_resetState ();
73
85
}
74
86
@@ -89,6 +101,7 @@ public function getTestObjectManager()
89
101
*/
90
102
public function tearDown (): void
91
103
{
104
+ $ this ->appState ->setAreaCode ($ this ->currentArea );
92
105
$ this ->objectManagerBeforeTest ->getFactory ()->setObjectManager ($ this ->objectManagerBeforeTest );
93
106
AppObjectManager::setInstance ($ this ->objectManagerBeforeTest );
94
107
Bootstrap::setObjectManager ($ this ->objectManagerBeforeTest );
You can’t perform that action at this time.
0 commit comments