FakeProcessSequence
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
Create a new fake process sequence instance.
Push a new process result or description onto the sequence.
Make the sequence return a default result when it is empty.
Convert the given result into an actual process result or description.
Make the sequence return a default result when it is empty.
Indicate that this sequence has depleted all of its process results.
Get the next process in the sequence.
Details
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.
protected ProcessResult|FakeProcessDescription
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.
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.