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

NotificationFake

Implements

Uses

Properties

protected

$notifications array

All of the notifications that have been sent.

Default: []
public

$locale string|null

Locale used when sending notifications.

Default: null

Methods

public

assertSentOnDemand ( $notification , $callback ) : void

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

Parameters

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

assertSentTo ( $notifiable , $notification , $callback ) : void

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

Parameters

  • $notifiable mixed
  • $notification string|Closure
  • $callback callable|null
public

assertSentOnDemandTimes ( $notification , $times ) : void

Assert if a notification was sent on-demand a number of times.

Parameters

  • $notification string
  • $times int
public

assertSentToTimes ( $notifiable , $notification , $times ) : void

Assert if a notification was sent a number of times.

Parameters

  • $notifiable mixed
  • $notification string
  • $times int
public

assertNotSentTo ( $notifiable , $notification , $callback ) : void

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

Parameters

  • $notifiable mixed
  • $notification string|Closure
  • $callback callable|null
public

assertNothingSent ( ) : void

Assert that no notifications were sent.

public

assertSentTimes ( $notification , $expectedCount ) : void

Assert the total amount of times a notification was sent.

Parameters

  • $notification string
  • $expectedCount int
deprecated public

assertTimesSent ( $expectedCount , $notification ) : void

Assert the total amount of times a notification was sent.

Parameters

  • $expectedCount int
  • $notification string
public

sent ( $notifiable , $notification , $callback ) : Collection

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

Parameters

  • $notifiable mixed
  • $notification string
  • $callback callable|null
public

hasSent ( $notifiable , $notification ) : bool

Determine if there are more notifications left to inspect.

Parameters

  • $notifiable mixed
  • $notification string
protected

notificationsFor ( $notifiable , $notification ) : array

Get all of the notifications for a notifiable entity by type.

Parameters

  • $notifiable mixed
  • $notification string
public

send ( $notifiables , $notification ) : void

Send the given notification to the given notifiable entities.

Parameters

  • $notifiables Collection |array|mixed
  • $notification mixed
public

sendNow ( $notifiables , $notification , array $channels ) : void

Send the given notification immediately.

Parameters

  • $notifiables Collection |array|mixed
  • $notification mixed
  • $channels array|null
public

channel ( $name ) : mixed

Get a channel instance by name.

Parameters

  • $name string|null
public

locale ( $locale ) : $this

Set the locale of notifications.

Parameters

  • $locale string