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

[2.x] Mail Faker need on test cancelled invitations #978

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

lam0819
Copy link
Contributor

@lam0819 lam0819 commented Feb 15, 2022

• Tests\Feature\InviteTeamMemberTest > team member invitations can be cancelled
Symfony\Component\Mime\Exception\LogicException

An email must have a "From" or a "Sender" header.

at vendor/symfony/mime/Message.php:132
128▕ throw new LogicException('An email must have a "To", "Cc", or "Bcc" header.');
129▕ }
130▕
131▕ if (!$this->headers->has('From') && !$this->headers->has('Sender')) {
➜ 132▕ throw new LogicException('An email must have a "From" or a "Sender" header.');
133▕ }
134▕
135▕ parent::ensureValidity();
136▕ }

  +11 vendor frames 

12 app/Actions/Jetstream/InviteTeamMember.php:39
Illuminate\Mail\PendingMail::send(Object(Laravel\Jetstream\Mail\TeamInvitation))

  +32 vendor frames 

45 tests/Feature/InviteTeamMemberTest.php:43
Livewire\Testing\TestableLivewire::call("addTeamMember")

 • Tests\Feature\InviteTeamMemberTest > team member invitations can be cancelled
   Symfony\Component\Mime\Exception\LogicException 

  An email must have a "From" or a "Sender" header.

  at vendor/symfony/mime/Message.php:132
    128▕             throw new LogicException('An email must have a "To", "Cc", or "Bcc" header.');
    129▕         }
    130▕ 
    131▕         if (!$this->headers->has('From') && !$this->headers->has('Sender')) {
  ➜ 132▕             throw new LogicException('An email must have a "From" or a "Sender" header.');
    133▕         }
    134▕ 
    135▕         parent::ensureValidity();
    136▕     }

      +11 vendor frames 
  12  app/Actions/Jetstream/InviteTeamMember.php:39
      Illuminate\Mail\PendingMail::send(Object(Laravel\Jetstream\Mail\TeamInvitation))

      +32 vendor frames 
  45  tests/Feature/InviteTeamMemberTest.php:43
      Livewire\Testing\TestableLivewire::call("addTeamMember")
@driesvints
Copy link
Member

Could also set the MAIL_FROM_ADDRESS env variable in your tests I think: https://github.com/laravel/laravel/blob/9.x/.env.example#L37

@driesvints driesvints changed the title Mail Faker need on test cancelled invitations [2.x] Mail Faker need on test cancelled invitations Feb 15, 2022
@taylorotwell taylorotwell merged commit 4701ed5 into laravel:2.x Feb 15, 2022
@ArnaudLier
Copy link

If added to test_team_member_invitations_can_be_cancelled, could be added to test_new_users_can_register and test_profile_information_can_be_updated too.

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