-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Argument #1 ($manager) must be of type Illuminate\Mail\MailManager #46180
Comments
This was changed here: #46055 because of #45988 @joelbutcher @stevebauman do you have any ideas here on how to fix this? |
I have the same issue! |
@driesvints I can't replicate this... I've written a test that that should cover this in the framework |
Thanks @joelbutcher. @alexgaal can you check this? ^ |
I've raised a PR covering this, too |
I believe it's because we declared multiple times: protected function setUp(): void
{
parent::setUp();
Mail::fake();
}
public function test_123(): void
{
Mail::fake(); Before it worked. Now we should declare only once |
@maloun96 that doesn't seems like valid code to me (even if it was working before). |
@driesvints indeed, legacy code... |
@alexgaal are you faking emails in a similar way? |
@maloun96 this is because your test uses |
True, thanks to all! |
@driesvints this issue raises a good point about testing with facades though. If a facade implements a @taylorotwell Might it be worth covering this use-case in the testing docs? |
It can be nice to have the ability to fake multiple times. |
@joelbutcher I don't think we document using faking like that anywhere? |
|
@alexgaal can you share the full test please? |
@driesvints Sure!
|
You're calling |
Oh, thank you Dries! I fixed that, it's working now. Thanks to all of you. |
@alexgaal @driesvints I'm working on a PR to |
Thanks all |
Hi @joelbutcher, Thanks and have a nice day/night. |
@driesvints @taylorotwell I think we need to consider documenting using |
Description:
We are using
Mail::fake
in a test and since we upgraded to Laravel 10 it's failing with following exception:Steps To Reproduce:
The text was updated successfully, but these errors were encountered: