BusFake

class BusFake implements Dispatcher (View source)

Properties

protected array $commands The commands that have been dispatched.

Methods

void assertDispatched(string $command, callable|int|null $callback = null)

Assert if a job was dispatched based on a truth-test callback.

void assertDispatchedTimes(string $command, int $times = 1)

Assert if a job was pushed a number of times.

void assertNotDispatched(string $command, callable|null $callback = null)

Determine if a job was dispatched based on a truth-test callback.

Collection dispatched(string $command, callable|null $callback = null)

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

bool hasDispatched(string $command)

Determine if there are any stored commands for a given class.

mixed dispatch(mixed $command)

Dispatch a command to its appropriate handler.

mixed dispatchNow(mixed $command, mixed $handler = null)

Dispatch a command to its appropriate handler in the current process.

$this pipeThrough(array $pipes)

Set the pipes commands should be piped through before dispatching.

bool hasCommandHandler(mixed $command)

Determine if the given command has a handler.

bool|mixed getCommandHandler(mixed $command)

Retrieve the handler for a command.

$this map(array $map)

Map a command to a handler.

Details

void assertDispatched(string $command, callable|int|null $callback = null)

Assert if a job was dispatched based on a truth-test callback.

Parameters

string $command
callable|int|null $callback

Return Value

void

protected void assertDispatchedTimes(string $command, int $times = 1)

Assert if a job was pushed a number of times.

Parameters

string $command
int $times

Return Value

void

void assertNotDispatched(string $command, callable|null $callback = null)

Determine if a job was dispatched based on a truth-test callback.

Parameters

string $command
callable|null $callback

Return Value

void

Collection dispatched(string $command, callable|null $callback = null)

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

Parameters

string $command
callable|null $callback

Return Value

Collection

bool hasDispatched(string $command)

Determine if there are any stored commands for a given class.

Parameters

string $command

Return Value

bool

mixed dispatch(mixed $command)

Dispatch a command to its appropriate handler.

Parameters

mixed $command

Return Value

mixed

mixed dispatchNow(mixed $command, mixed $handler = null)

Dispatch a command to its appropriate handler in the current process.

Parameters

mixed $command
mixed $handler

Return Value

mixed

$this pipeThrough(array $pipes)

Set the pipes commands should be piped through before dispatching.

Parameters

array $pipes

Return Value

$this

bool hasCommandHandler(mixed $command)

Determine if the given command has a handler.

Parameters

mixed $command

Return Value

bool

bool|mixed getCommandHandler(mixed $command)

Retrieve the handler for a command.

Parameters

mixed $command

Return Value

bool|mixed

$this map(array $map)

Map a command to a handler.

Parameters

array $map

Return Value

$this

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.7/Illuminate/Support/Testing/Fakes/BusFake.html