Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev committed Sep 11, 2018
1 parent ac42a58 commit 2a72a44
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Integration/Console/ConsoleApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a72a44

Please sign in to comment.