Skip to content

[9.x] Adds "PendingCommand::assertOk()"#43968

Merged
taylorotwell merged 1 commit into
9.xfrom
feat/artisan-assert-ok
Sep 1, 2022
Merged

[9.x] Adds "PendingCommand::assertOk()"#43968
taylorotwell merged 1 commit into
9.xfrom
feat/artisan-assert-ok

Conversation

@nunomaduro

@nunomaduro nunomaduro commented Sep 1, 2022

Copy link
Copy Markdown
Member

While creating tests for Artisan commands, I've noticed that assertSuccessful is just too many characters for me. So, this pull request proposes an assertOk() method that is simply an alias of assertExitCode(0):

it('can run', function () {
    $this->artisan('inspire')->assertOk();
});

Note that, this combines well with the HTTP layer regarding testing, as we we already have an assertOk() there:

$this->get('/')->assertOk();

@taylorotwell taylorotwell merged commit 3b6c7ad into 9.x Sep 1, 2022
@taylorotwell taylorotwell deleted the feat/artisan-assert-ok branch September 1, 2022 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants