Skip to content

[8.x] Make mailable assertions fluent#38850

Merged
taylorotwell merged 1 commit intolaravel:8.xfrom
macbookandrew:feature/fluent-mailable-assertions
Sep 17, 2021
Merged

[8.x] Make mailable assertions fluent#38850
taylorotwell merged 1 commit intolaravel:8.xfrom
macbookandrew:feature/fluent-mailable-assertions

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

Comments