class Illuminate / Support / Testing / Fakes / MailFake
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

MailFake

Implements

Uses

Properties

public

$manager MailManager

The mailer instance.

Default: null
protected

$currentMailer string

The mailer currently being used to send a message.

Default: null
protected

$mailables array

All of the mailables that have been sent.

Default: []
protected

$queuedMailables array

All of the mailables that have been queued.

Default: []

Methods

public

__construct ( MailManager $manager ) : void

Create a new mail fake.

Parameters

public

assertSent ( $mailable , $callback ) : void

Assert if a mailable was sent based on a truth-test callback.

Parameters

  • $mailable string|Closure
  • $callback callable|int|null
protected

assertSentTimes ( $mailable , $times ) : void

Assert if a mailable was sent a number of times.

Parameters

  • $mailable string
  • $times int
public

assertNotOutgoing ( $mailable , $callback ) : void

Determine if a mailable was not sent or queued to be sent based on a truth-test callback.

Parameters

  • $mailable string|Closure
  • $callback callable|null
public

assertNotSent ( $mailable , $callback ) : void

Determine if a mailable was not sent based on a truth-test callback.

Parameters

  • $mailable string|Closure
  • $callback callable|null
public

assertNothingOutgoing ( ) : void

Assert that no mailables were sent or queued to be sent.

public

assertNothingSent ( ) : void

Assert that no mailables were sent.

public

assertQueued ( $mailable , $callback ) : void

Assert if a mailable was queued based on a truth-test callback.

Parameters

  • $mailable string|Closure
  • $callback callable|int|null
protected

assertQueuedTimes ( $mailable , $times ) : void

Assert if a mailable was queued a number of times.

Parameters

  • $mailable string
  • $times int
public

assertNotQueued ( $mailable , $callback ) : void

Determine if a mailable was not queued based on a truth-test callback.

Parameters

  • $mailable string|Closure
  • $callback callable|null
public

assertNothingQueued ( ) : void

Assert that no mailables were queued.

public

assertSentCount ( $count ) : void

Assert the total number of mailables that were sent.

Parameters

  • $count int
public

assertQueuedCount ( $count ) : void

Assert the total number of mailables that were queued.

Parameters

  • $count int
public

assertOutgoingCount ( $count ) : void

Assert the total number of mailables that were sent or queued.

Parameters

  • $count int
public

sent ( $mailable , $callback ) : Illuminate\...\Collection

Get all of the mailables matching a truth-test callback.

Parameters

  • $mailable string|Closure
  • $callback callable|null
public

hasSent ( $mailable ) : bool

Determine if the given mailable has been sent.

Parameters

  • $mailable string
public

queued ( $mailable , $callback ) : Illuminate\...\Collection

Get all of the queued mailables matching a truth-test callback.

Parameters

  • $mailable string|Closure
  • $callback callable|null
public

hasQueued ( $mailable ) : bool

Determine if the given mailable has been queued.

Parameters

  • $mailable string
protected

mailablesOf ( $type ) : Illuminate\...\Collection

Get all of the mailed mailables for a given type.

Parameters

  • $type string
protected

queuedMailablesOf ( $type ) : Illuminate\...\Collection

Get all of the mailed mailables for a given type.

Parameters

  • $type string
public

mailer ( $name ) : Mailer

Get a mailer instance by name.

Parameters

  • $name string|null
public

to ( $users ) : PendingMail

Begin the process of mailing a mailable class instance.

Parameters

  • $users mixed
public

cc ( $users ) : PendingMail

Begin the process of mailing a mailable class instance.

Parameters

  • $users mixed
public

bcc ( $users ) : PendingMail

Begin the process of mailing a mailable class instance.

Parameters

  • $users mixed
public

raw ( $text , $callback ) : void

Send a new message with only a raw text part.

Parameters

  • $text string
  • $callback Closure |string
public

send ( $view , array $data , $callback ) : void

Send a new message using a view.

Parameters

public

queue ( $view , $queue ) : mixed

Queue a new e-mail message for sending.

Parameters

  • $view Mailable |string|array
  • $queue string|null
public

later ( $delay , $view , $queue ) : mixed

Queue a new e-mail message for sending after (n) seconds.

Parameters

protected

prepareMailableAndCallback ( $mailable , $callback ) : array

Infer mailable class using reflection if a typehinted closure is passed to assertion.

Parameters

  • $mailable string|Closure
  • $callback callable|null
public

forgetMailers ( ) : $this

Forget all of the resolved mailer instances.

public

__call ( $method , $parameters ) : mixed

Handle dynamic method calls to the mailer.

Parameters

  • $method string
  • $parameters array