From 2a72a44256a8c04bbe78efe89db30e9d31e9d38d Mon Sep 17 00:00:00 2001 From: a-komarev Date: Tue, 11 Sep 2018 16:04:57 +0300 Subject: [PATCH] Add tests --- .../Console/ConsoleApplicationTest.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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