class BusFake implements Dispatcher

Properties

protected array $commands

The commands that have been dispatched.

Methods

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

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

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

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

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.

Details

at line 24
void assertDispatched(string $command, callable|null $callback = null)

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

Parameters

string $command
callable|null $callback

Return Value

void

at line 39
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

at line 54
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

at line 75
bool hasDispatched(string $command)

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

Parameters

string $command

Return Value

bool

at line 86
mixed dispatch(mixed $command)

Dispatch a command to its appropriate handler.

Parameters

mixed $command

Return Value

mixed

at line 98
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

at line 109
$this pipeThrough(array $pipes)

Set the pipes commands should be piped through before dispatching.

Parameters

array $pipes

Return Value

$this