Skip to content

[9.x] Add doesntExpectOutputToContain assertion method#42096

Merged
taylorotwell merged 2 commits into
laravel:9.xfrom
hebinet:extend-pending-command-assertions
Apr 22, 2022
Merged

[9.x] Add doesntExpectOutputToContain assertion method#42096
taylorotwell merged 2 commits into
laravel:9.xfrom
hebinet:extend-pending-command-assertions

Conversation

@hebinet

@hebinet hebinet commented Apr 22, 2022

Copy link
Copy Markdown
Contributor

This PR adds the new Command assertion method doesntExpectOutputToContain

Usage

Artisan::command('contains', function () {
    $this->line('My name is Taylor Otwell');
});

$this->artisan('contains')
    ->doesntExpectOutputToContain('Taylor Otwell')

Why do I think this is usefull?
Lately I had to check for a String which wasn't included in the Output of a Command and I was suprised that there are the methods expectsOutput, doesntExpectOutput and expectsOutputToContain but no doesntExpectOutputToContain.

So here it is 😄

@taylorotwell taylorotwell merged commit bce3cf8 into laravel:9.x Apr 22, 2022
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