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] Allow for closure reflection on all MailFake assertions #38328

Merged

Conversation

inxilpro
Copy link
Contributor

Right now, only the positive assertions on the MailFake class allow for passing a closure rather than a FQCN and a closure:

// This works:
Mail::assertSent(fn(MyMailable $mail) => $mail->hasTo('foo@bar.com'));

// This doesn't:
Mail::assertNotSent(fn(MyMailable $mail) => $mail->hasTo('foo@bar.com'));

// Instead, right now you must do:
Mail::assertNotSent(MyMailable::class, fn(MyMailable $mail) => $mail->hasTo('foo@bar.com'));

This PR updates all the MailFake assertions to allow for the single closure API.

@taylorotwell taylorotwell merged commit ebe072a into laravel:8.x Aug 10, 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.

None yet

3 participants