Skip to content
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

[8.x] Make mailable assertions fluent #38850

Merged

Conversation

macbookandrew
Copy link
Contributor

This adds a bit of nice DX so mailable assertions are fluent similar to HTTP assertions.

Before:

$mail = new WelcomeEmail($user);

$mail->assertSeeInHtml('Welcome, '.$user->name.'!');
$mail->assertSeeInText('Welcome, '.$user->name.'!');

After:

$mail = new WelcomeEmail($user);

$mail
    ->assertSeeInHtml('Welcome, '.$user->name.'!')
    ->assertSeeInText('Welcome, '.$user->name.'!');

// Alternative

(new WelcomeEmail($user))
    ->assertSeeInHtml('Welcome, '.$user->name.'!')
    ->assertSeeInText('Welcome, '.$user->name.'!');

@taylorotwell taylorotwell merged commit 8fafa89 into laravel:8.x Sep 17, 2021
@andrewminion-luminfire andrewminion-luminfire deleted the feature/fluent-mailable-assertions branch September 17, 2021 17:48
@GrahamCampbell GrahamCampbell changed the title [8.x] - make mailable assertions fluent [8.x] Make mailable assertions fluent Sep 17, 2021
victorvilella pushed a commit to cdsistemas/framework that referenced this pull request Oct 12, 2021
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