@@ -28,7 +28,11 @@ public function it_has_static_constructor_named_factory()
2828 $ this ->assertInstanceOf (Command::class, $ command );
2929 }
3030
31- /** @test */
31+ /**
32+ * @test
33+ * @runInSeparateProcess
34+ * @preserveGlobalState disabled
35+ */
3236 public function it_can_run_command_in_background ()
3337 {
3438 $ this ->expectsExecWith ('(php artisan test:command) > /dev/null 2>&1 & ' );
@@ -38,6 +42,22 @@ public function it_can_run_command_in_background()
3842 }
3943
4044 /** @test */
45+ public function which_also_works_for_windows ()
46+ {
47+ require_once 'mocks.php ' ;
48+
49+ $ this ->emulateWindowsOs ();
50+ $ this ->expectsExecWith ('start /B php artisan test:command ' );
51+
52+ $ command = Command::factory ('test:command ' );
53+ $ command ->runInBackground ();
54+ }
55+
56+ /**
57+ * @test
58+ * @runInSeparateProcess
59+ * @preserveGlobalState disabled
60+ */
4161 public function run_in_background_supports_before_subcommand ()
4262 {
4363 $ this ->expectsExecWith ('(before command && php artisan test:command) > /dev/null 2>&1 & ' );
@@ -46,7 +66,11 @@ public function run_in_background_supports_before_subcommand()
4666 $ command ->runInBackground ();
4767 }
4868
49- /** @test */
69+ /**
70+ * @test
71+ * @runInSeparateProcess
72+ * @preserveGlobalState disabled
73+ */
5074 public function run_in_background_supports_after_subcommand ()
5175 {
5276 $ this ->expectsExecWith ('(php artisan test:command && after command) > /dev/null 2>&1 & ' );
@@ -55,7 +79,11 @@ public function run_in_background_supports_after_subcommand()
5579 $ command ->runInBackground ();
5680 }
5781
58- /** @test */
82+ /**
83+ * @test
84+ * @runInSeparateProcess
85+ * @preserveGlobalState disabled
86+ */
5987 public function run_in_background_supports_before_and_after_subcommands_together ()
6088 {
6189 $ this ->expectsExecWith ('(before && php artisan test:command && after) > /dev/null 2>&1 & ' );
0 commit comments