class Illuminate / Support / Testing / Fakes / MailFake
You are viewing an older version of the documentation. For the latest, please visit master documentation.

MailFake

Implements

Uses

Properties

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

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

sent ( $mailable , $callback ) : 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 ) : 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 ) : Collection

Get all of the mailed mailables for a given type.

Parameters

  • $type string
protected

queuedMailablesOf ( $type ) : 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

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

public

failures ( ) : array

Get the array of failed recipients.

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.