Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[10.x] Escape values before checking for their presence in HTML part of Mailables #42923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2022

Conversation

turanjanin
Copy link
Contributor

Laravel offers the ability to assert presence of a value inside the HTML for both views and mailables. However, the implementation of these assertions differ in a way that may cause confusion and occasional failing tests:

TestResponse::assertSee() escapes the HTML by default,
Mailable::assertSeeInHtml() does not escape the HTML.

This means that, for the same HTML, $response->assertSee("O'Connor"); will pass, while $mail->assertSeeInHtml("O'Connor"); will fail.

The goal of this PR is to align the behaviour of Mailable assertion methods with the rest of the similar assertion methods.

@turanjanin turanjanin force-pushed the fix-mailable-assertions branch from 99f389a to 3ec397b Compare June 29, 2022 09:14
@turanjanin turanjanin changed the title Escape values before checking for their presence in HTML part of Mailables [10.x] Escape values before checking for their presence in HTML part of Mailables Jun 29, 2022
@taylorotwell taylorotwell merged commit 55a1ea2 into laravel:master Jun 30, 2022
@turanjanin turanjanin deleted the fix-mailable-assertions branch June 30, 2022 14:34
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.