Skip to content

Let Mail::fake() resolve the mail manager itself - #256

Merged
LukeTowers merged 1 commit into
wintercms:wip/1.3from
JonasPardon:fix/mail-fake-without-manager
Oct 8, 2026
Merged

LukeTowers merged 1 commit into
wintercms:wip/1.3from
JonasPardon:fix/mail-fake-without-manager

Conversation

@JonasPardon

Copy link
Copy Markdown

Mail::fake() without an argument throws on wip/1.3:

ArgumentCountError: Too few arguments to function Winter\Storm\Support\Facades\Mail::fake(), 0 passed

This is what currently fails Winter's own tests on wip/1.3: AuthRestoreOracleTest calls Mail::fake(), and all five of its tests error on every job of the latest run. It also breaks every project and plugin test that calls Mail::fake().

Laravel 10's MailFake needs the mail manager, so 0a6b24e made it a required argument of fake(). Laravel's own facade resolves the manager itself. Storm's Mail facade points at mailer instead of mail.manager, so it can't use the facade root the way Laravel does.

  • Make $manager optional. When it's omitted, take mail.manager from the container, or the real manager the current fake wraps if the facade is already faked, like Laravel does. Passing a manager still works.
  • Add tests for all three cases. The two without an argument fail without the change.

Checked against Winter: with this branch as vendor/winter/storm, AuthRestoreOracleTest on wip/1.3 goes from 5 errors to passing.

🤖 Generated with Claude Code

Since the Laravel 10 MailFake changes, fake() required the manager as an argument, so every existing Mail::fake() call threw an ArgumentCountError, including Winter's own AuthRestoreOracleTest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6543b56c-87bc-4588-ab58-9ddbfb5f07b8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LukeTowers
LukeTowers merged commit 4dda145 into wintercms:wip/1.3 Oct 8, 2026
10 checks passed
@JonasPardon JonasPardon mentioned this pull request Oct 8, 2026
5 of 17 tasks
@JonasPardon
JonasPardon deleted the fix/mail-fake-without-manager branch October 8, 2026 15:08
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