MailFake
class MailFake implements Mailer, MailQueue (View source)
Properties
protected array | $mailables | All of the mailables that have been sent. | |
protected array | $queuedMailables | All of the mailables that have been queued. |
Methods
void | assertSent(string $mailable, callable|int|null $callback = null) Assert if a mailable was sent based on a truth-test callback. | |
void | assertSentTimes(string $mailable, int $times = 1) Assert if a mailable was sent a number of times. | |
void | assertNotSent(string $mailable, callable|null $callback = null) Determine if a mailable was not sent based on a truth-test callback. | |
void | assertNothingSent() Assert that no mailables were sent. | |
void | assertQueued(string $mailable, callable|int|null $callback = null) Assert if a mailable was queued based on a truth-test callback. | |
void | assertQueuedTimes(string $mailable, int $times = 1) Assert if a mailable was queued a number of times. | |
void | assertNotQueued(string $mailable, callable|null $callback = null) Determine if a mailable was not queued based on a truth-test callback. | |
void | assertNothingQueued() Assert that no mailables were queued. | |
Collection | sent(string $mailable, callable|null $callback = null) Get all of the mailables matching a truth-test callback. | |
bool | hasSent(string $mailable) Determine if the given mailable has been sent. | |
Collection | queued(string $mailable, callable|null $callback = null) Get all of the queued mailables matching a truth-test callback. | |
bool | hasQueued(string $mailable) Determine if the given mailable has been queued. | |
Collection | mailablesOf(string $type) Get all of the mailed mailables for a given type. | |
Collection | queuedMailablesOf(string $type) Get all of the mailed mailables for a given type. | |
PendingMail | to(mixed $users) Begin the process of mailing a mailable class instance. | |
PendingMail | bcc(mixed $users) Begin the process of mailing a mailable class instance. | |
void | raw(string $text, mixed $callback) Send a new message when only a raw text part. | |
void | send(string|array|Mailable $view, array $data = [], Closure|string $callback = null) Send a new message using a view. | |
mixed | queue(string|array|Mailable $view, string $queue = null) Queue a new e-mail message for sending. | |
mixed | later(DateTimeInterface|DateInterval|int $delay, string|array|Mailable $view, string $queue = null) Queue a new e-mail message for sending after (n) seconds. | |
array | failures() Get the array of failed recipients. |
Details
void assertSent(string $mailable, callable|int|null $callback = null)
Assert if a mailable was sent based on a truth-test callback.
protected void assertSentTimes(string $mailable, int $times = 1)
Assert if a mailable was sent a number of times.
void assertNotSent(string $mailable, callable|null $callback = null)
Determine if a mailable was not sent based on a truth-test callback.
void assertNothingSent()
Assert that no mailables were sent.
void assertQueued(string $mailable, callable|int|null $callback = null)
Assert if a mailable was queued based on a truth-test callback.
protected void assertQueuedTimes(string $mailable, int $times = 1)
Assert if a mailable was queued a number of times.
void assertNotQueued(string $mailable, callable|null $callback = null)
Determine if a mailable was not queued based on a truth-test callback.
void assertNothingQueued()
Assert that no mailables were queued.
Collection sent(string $mailable, callable|null $callback = null)
Get all of the mailables matching a truth-test callback.
bool hasSent(string $mailable)
Determine if the given mailable has been sent.
Collection queued(string $mailable, callable|null $callback = null)
Get all of the queued mailables matching a truth-test callback.
bool hasQueued(string $mailable)
Determine if the given mailable has been queued.
protected Collection mailablesOf(string $type)
Get all of the mailed mailables for a given type.
protected Collection queuedMailablesOf(string $type)
Get all of the mailed mailables for a given type.
PendingMail to(mixed $users)
Begin the process of mailing a mailable class instance.
PendingMail bcc(mixed $users)
Begin the process of mailing a mailable class instance.
void raw(string $text, mixed $callback)
Send a new message when only a raw text part.
void send(string|array|Mailable $view, array $data = [], Closure|string $callback = null)
Send a new message using a view.
mixed queue(string|array|Mailable $view, string $queue = null)
Queue a new e-mail message for sending.
mixed later(DateTimeInterface|DateInterval|int $delay, string|array|Mailable $view, string $queue = null)
Queue a new e-mail message for sending after (n) seconds.
array failures()
Get the array of failed recipients.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.7/Illuminate/Support/Testing/Fakes/MailFake.html