-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
108 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,6 +211,37 @@ public function testMessageWithToAddress() | |
$channel->send($notifiable, $notification); | ||
} | ||
|
||
public function testMessageWithToCcEmails() | ||
{ | ||
$notification = new NotificationMailChannelTestNotificationWithCcEmails; | ||
$notifiable = new NotificationMailChannelTestNotifiable; | ||
|
||
$message = $notification->toMail($notifiable); | ||
$data = $message->toArray(); | ||
|
||
$channel = new Illuminate\Notifications\Channels\MailChannel( | ||
$mailer = Mockery::mock(Illuminate\Contracts\Mail\Mailer::class) | ||
); | ||
|
||
$views = ['notifications::email', 'notifications::email-plain']; | ||
|
||
$mailer->shouldReceive('send')->with($views, $data, Mockery::on(function ($closure) { | ||
$mock = Mockery::mock('Illuminate\Mailer\Message'); | ||
|
||
$mock->shouldReceive('subject')->once(); | ||
|
||
$mock->shouldReceive('to')->once()->with('[email protected]'); | ||
|
||
$mock->shouldReceive('cc')->once()->with(['[email protected]', '[email protected]']); | ||
|
||
$closure($mock); | ||
|
||
return true; | ||
})); | ||
|
||
$channel->send($notifiable, $notification); | ||
} | ||
|
||
public function testMessageWithPriority() | ||
{ | ||
$notification = new NotificationMailChannelTestNotificationWithPriority; | ||
|
@@ -318,6 +349,15 @@ public function toMail($notifiable) | |
} | ||
} | ||
|
||
class NotificationMailChannelTestNotificationWithCcEmails extends Notification | ||
{ | ||
public function toMail($notifiable) | ||
{ | ||
return (new MailMessage) | ||
->cc(['[email protected]', '[email protected]']); | ||
} | ||
} | ||
|
||
class NotificationMailChannelTestNotificationWithPriority extends Notification | ||
{ | ||
public function toMail($notifiable) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters