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

[10.x] Use MailManager as underlying passthru object for MailFake #46055

Merged
merged 2 commits into from
Feb 9, 2023

Conversation

joelbutcher
Copy link
Contributor

This PR fixes a bug introduced in #45988 where calling Mail::fake() throws the following TypeError:

TypeError: Illuminate\Support\Testing\Fakes\MailFake::__construct(): Argument #1 ($mailer) must be of type Illuminate\Contracts\Mail\Mailer, Illuminate\Mail\MailManager given, called in /home/runner/work/jetstream/jetstream/vendor/laravel/framework/src/Illuminate/Support/Facades/Mail.php on line 68

/home/runner/work/jetstream/jetstream/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/MailFake.php:53
/home/runner/work/jetstream/jetstream/vendor/laravel/framework/src/Illuminate/Support/Facades/Mail.php:68

I've added two new test cases to ensure the intended functionality for the original PR remains – please let me know if you want these moved to a better suited directory.

@joelbutcher joelbutcher changed the base branch from 9.x to 10.x February 9, 2023 12:32
@driesvints driesvints changed the title 10.x Use MailManager as underlying passthru object for MailFake [10.x] Use MailManager as underlying passthru object for MailFake Feb 9, 2023
Copy link
Member

@driesvints driesvints left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @joelbutcher. Lgtm

@stevebauman
Copy link
Contributor

Sorry guys! I thought the root Mail facade instance was the Mailer. Thanks so much for patching this @joelbutcher, really appreciate it 🙏

@taylorotwell taylorotwell merged commit 2c51b48 into laravel:10.x Feb 9, 2023
@joelbutcher joelbutcher deleted the fix-mail-passthru-fakes branch February 20, 2023 17:11
driesvints added a commit that referenced this pull request Feb 24, 2023
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.

4 participants