@@ -78,15 +78,17 @@ protected function setUp()
78
78
$ this ->prevMode = $ this ->objectManager ->get (State::class)->getMode ();
79
79
$ this ->filesystem = $ this ->objectManager ->get (Filesystem::class);
80
80
81
- $ this ->config = $ this ->loadConfig ();
82
- $ this ->envConfig = $ this ->loadEnvConfig ();
81
+ // Load the original config to restore it on teardown
82
+ $ this ->config = $ this ->reader ->load (ConfigFilePool::APP_CONFIG );
83
+ $ this ->envConfig = $ this ->reader ->load (ConfigFilePool::APP_ENV );
83
84
}
84
85
85
86
/**
86
87
* @inheritdoc
87
88
*/
88
89
public function tearDown ()
89
90
{
91
+ // Restore the original config
90
92
$ this ->writer ->saveConfig ([ConfigFilePool::APP_CONFIG => $ this ->config ]);
91
93
$ this ->writer ->saveConfig ([ConfigFilePool::APP_ENV => $ this ->envConfig ]);
92
94
@@ -128,9 +130,14 @@ public function testSwitchMode()
128
130
}
129
131
}
130
132
133
+ /**
134
+ * Enable production mode
135
+ *
136
+ * @return void
137
+ */
131
138
private function enableAndAssertProductionMode ()
132
139
{
133
- // enable production mode
140
+ // Enable production mode
134
141
$ this ->clearStaticFiles ();
135
142
$ this ->commandTester = new CommandTester ($ this ->getStaticContentDeployCommand ());
136
143
$ this ->commandTester ->execute (
@@ -149,7 +156,9 @@ private function enableAndAssertProductionMode()
149
156
}
150
157
151
158
/**
152
- * Enable
159
+ * Enable developer mode
160
+ *
161
+ * @return void
153
162
*/
154
163
private function enableAndAssertDeveloperMode ()
155
164
{
@@ -199,20 +208,4 @@ function ($output) use ($objectManager) {
199
208
200
209
return $ deployStaticContentCommand ;
201
210
}
202
-
203
- /**
204
- * @return array
205
- */
206
- private function loadConfig ()
207
- {
208
- return $ this ->reader ->load (ConfigFilePool::APP_CONFIG );
209
- }
210
-
211
- /**
212
- * @return array
213
- */
214
- private function loadEnvConfig ()
215
- {
216
- return $ this ->reader ->load (ConfigFilePool::APP_ENV );
217
- }
218
211
}
0 commit comments