Skip to content

[9.x] Add TestResponse::assertContent($string) - #44580

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
timacdonald:assert-content
Oct 14, 2022
Merged

[9.x] Add TestResponse::assertContent($string)#44580
taylorotwell merged 1 commit into
laravel:9.xfrom
timacdonald:assert-content

Conversation

@timacdonald

@timacdonald timacdonald commented Oct 14, 2022

Copy link
Copy Markdown
Member

Papercut: asserting the exact string content of a test response feels out of place with the existing response assertions.

// Response content string should match this exactly. Nothing more. Nothing less.

// before...

$this->assertSame('foo bar', $response->content());

// after...

$response->assertContent('foo bar');

@taylorotwell
taylorotwell merged commit c703de3 into laravel:9.x Oct 14, 2022
@timacdonald
timacdonald deleted the assert-content branch January 10, 2023 01:23
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