MocksApplicationServices (Foundation\Testing)

MocksApplicationServices

trait MocksApplicationServices (View source)

Methods

$this expectsEvents(array|string $events)

Specify a list of events that should be fired for the given operation.

$this doesntExpectEvents(array|string $events)

Specify a list of events that should not be fired for the given operation.

$this expectsModelEvents(string $model, array|string $events)

Specify a list of events that should be fired for the given operation.

$this doesntExpectModelEvents(string $model, array|string $events)

Specify a list of events that should not be fired for the given operation.

$this withoutObservers(array|string $observers)

Specify a list of observers that will not run for the given operation.

Details

$this expectsEvents(array|string $events)

Specify a list of events that should be fired for the given operation.

These events will be mocked, so that handlers will not actually be executed.

Parameters

array|string $events

Return Value

$this

Exceptions

Exception

$this doesntExpectEvents(array|string $events)

Specify a list of events that should not be fired for the given operation.

These events will be mocked, so that handlers will not actually be executed.

Parameters

array|string $events

Return Value

$this

$this expectsModelEvents(string $model, array|string $events)

Specify a list of events that should be fired for the given operation.

These events will be mocked, so that handlers will not actually be executed.

Parameters

string $model
array|string $events

Return Value

$this

Exceptions

Exception

$this doesntExpectModelEvents(string $model, array|string $events)

Specify a list of events that should not be fired for the given operation.

These events will be mocked, so that handlers will not actually be executed.

Parameters

string $model
array|string $events

Return Value

$this

Exceptions

Exception

$this withoutObservers(array|string $observers)

Specify a list of observers that will not run for the given operation.

Parameters

array|string $observers

Return Value

$this

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.3/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部