class FakeProcessSequence (View source)

Properties

protected array $processes

The fake process results and descriptions.

protected bool $failWhenEmpty

Indicates that invoking this sequence when it is empty should throw an exception.

protected ProcessResult|FakeProcessDescription $emptyProcess

The response that should be returned when the sequence is empty.

Methods

void
__construct(array $processes = [])

Create a new fake process sequence instance.

$this
push(ProcessResult|FakeProcessDescription|array|string $process)

Push a new process result or description onto the sequence.

$this
whenEmpty(ProcessResult|FakeProcessDescription|array|string $process)

Make the sequence return a default result when it is empty.

toProcessResult(ProcessResult|FakeProcessDescription|array|string $process)

Convert the given result into an actual process result or description.

$this
dontFailWhenEmpty()

Make the sequence return a default result when it is empty.

bool
isEmpty()

Indicate that this sequence has depleted all of its process results.

__invoke()

Get the next process in the sequence.

Details

void __construct(array $processes = [])

Create a new fake process sequence instance.

Parameters

array $processes

Return Value

void

$this push(ProcessResult|FakeProcessDescription|array|string $process)

Push a new process result or description onto the sequence.

Parameters

ProcessResult|FakeProcessDescription|array|string $process

Return Value

$this

$this whenEmpty(ProcessResult|FakeProcessDescription|array|string $process)

Make the sequence return a default result when it is empty.

Parameters

ProcessResult|FakeProcessDescription|array|string $process

Return Value

$this

protected ProcessResult|FakeProcessDescription toProcessResult(ProcessResult|FakeProcessDescription|array|string $process)

Convert the given result into an actual process result or description.

Parameters

ProcessResult|FakeProcessDescription|array|string $process

Return Value

ProcessResult|FakeProcessDescription

$this dontFailWhenEmpty()

Make the sequence return a default result when it is empty.

Return Value

$this

bool isEmpty()

Indicate that this sequence has depleted all of its process results.

Return Value

bool

ProcessResult|FakeProcessDescription __invoke()

Get the next process in the sequence.

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.