@@ -195,34 +195,6 @@ protected function setupDuskEnvironment()
195
195
$ this ->setupSignalHandler ();
196
196
}
197
197
198
- /**
199
- * Setup the SIGINT signal handler for CTRL+C exits.
200
- *
201
- * @return void
202
- */
203
- protected function setupSignalHandler ()
204
- {
205
- pcntl_async_signals (true );
206
-
207
- pcntl_signal (SIGINT , function () {
208
- $ this ->teardownDuskEnviroment ();
209
- });
210
- }
211
-
212
- /**
213
- * Restore the original environment.
214
- *
215
- * @return void
216
- */
217
- protected function teardownDuskEnviroment ()
218
- {
219
- $ this ->removeConfiguration ();
220
-
221
- if (file_exists (base_path ($ this ->duskFile ())) && file_exists (base_path ('.env.backup ' ))) {
222
- $ this ->restoreEnvironment ();
223
- }
224
- }
225
-
226
198
/**
227
199
* Backup the current environment file.
228
200
*
@@ -235,26 +207,14 @@ protected function backupEnvironment()
235
207
copy (base_path ($ this ->duskFile ()), base_path ('.env ' ));
236
208
}
237
209
238
- /**
239
- * Restore the backed-up environment file.
240
- *
241
- * @return void
242
- */
243
- protected function restoreEnvironment ()
244
- {
245
- copy (base_path ('.env.backup ' ), base_path ('.env ' ));
246
-
247
- unlink (base_path ('.env.backup ' ));
248
- }
249
-
250
210
/**
251
211
* Refresh the current environment variables.
252
212
*
253
213
* @return void
254
214
*/
255
215
protected function refreshEnvironment ()
256
216
{
257
- // BC fix to support Dotenv ^2.2
217
+ // BC fix to support Dotenv ^2.2...
258
218
if (! method_exists (Dotenv::class, 'create ' )) {
259
219
(new Dotenv (base_path ()))->overload ();
260
220
@@ -281,6 +241,34 @@ protected function writeConfiguration()
281
241
$ this ->hasPhpUnitConfiguration = true ;
282
242
}
283
243
244
+ /**
245
+ * Setup the SIGINT signal handler for CTRL+C exits.
246
+ *
247
+ * @return void
248
+ */
249
+ protected function setupSignalHandler ()
250
+ {
251
+ pcntl_async_signals (true );
252
+
253
+ pcntl_signal (SIGINT , function () {
254
+ $ this ->teardownDuskEnviroment ();
255
+ });
256
+ }
257
+
258
+ /**
259
+ * Restore the original environment.
260
+ *
261
+ * @return void
262
+ */
263
+ protected function teardownDuskEnviroment ()
264
+ {
265
+ $ this ->removeConfiguration ();
266
+
267
+ if (file_exists (base_path ($ this ->duskFile ())) && file_exists (base_path ('.env.backup ' ))) {
268
+ $ this ->restoreEnvironment ();
269
+ }
270
+ }
271
+
284
272
/**
285
273
* Remove the Dusk PHPUnit configuration.
286
274
*
@@ -293,6 +281,18 @@ protected function removeConfiguration()
293
281
}
294
282
}
295
283
284
+ /**
285
+ * Restore the backed-up environment file.
286
+ *
287
+ * @return void
288
+ */
289
+ protected function restoreEnvironment ()
290
+ {
291
+ copy (base_path ('.env.backup ' ), base_path ('.env ' ));
292
+
293
+ unlink (base_path ('.env.backup ' ));
294
+ }
295
+
296
296
/**
297
297
* Get the name of the Dusk file for the environment.
298
298
*
0 commit comments