diff --git a/tests/Integration/Console/ConsoleApplicationTest.php b/tests/Integration/Console/ConsoleApplicationTest.php index b5424ed960ab..ddcba2e8c2e3 100644 --- a/tests/Integration/Console/ConsoleApplicationTest.php +++ b/tests/Integration/Console/ConsoleApplicationTest.php @@ -28,6 +28,28 @@ public function test_artisan_call_using_command_class() 'id' => 1, ])->assertExitCode(0); } + + public function test_artisan_call_now() + { + $outputWithoutMock = $this->artisan('foo:bar', [ + 'id' => 1, + ])->callNow(); + + $this->assertSame(0, $outputWithoutMock); + } + + public function test_artisan_with_mock_call_after_call_now() + { + $outputWithoutMock = $this->artisan('foo:bar', [ + 'id' => 1, + ])->callNow(); + $outputWithMock = $this->artisan('foo:bar', [ + 'id' => 1, + ]); + + $this->assertSame(0, $outputWithoutMock); + $outputWithMock->assertExitCode(0); + } } class FooCommandStub extends Command