Factory
class Factory (View source)
Traits
Properties
static protected array | $macros | The registered string macros. |
from Macroable |
protected bool | $recording | Indicates if the process factory has faked process handlers. |
|
protected array | $recorded | All of the recorded processes. |
|
protected array | $fakeHandlers | The registered fake handler callbacks. |
|
protected bool | $preventStrayProcesses | Indicates that an exception should be thrown if any process is not faked. |
Methods
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically proxy methods to a new pending process instance.
Create a new fake process response for testing purposes.
Begin describing a fake process lifecycle.
Begin describing a fake process sequence.
Indicate that the process factory should fake processes.
Determine if the process factory has fake process handlers and is recording processes.
Record the given process if processes should be recorded.
Indicate that an exception should be thrown if any process is not faked.
Determine if stray processes are being prevented.
Assert that a process was recorded matching a given truth test.
Assert that a process was recorded a given number of times matching a given truth test.
Assert that a process was not recorded matching a given truth test.
Assert that a process was not recorded matching a given truth test.
Assert that no processes were recorded.
Start defining a series of piped processes.
Run a pool of processes and wait for them to finish executing.
Create a new pending process associated with this factory.
Details
mixed
__call(string $method, array $parameters)
Dynamically proxy methods to a new pending process instance.
FakeProcessResult
result(array|string $output = '', array|string $errorOutput = '', int $exitCode = 0)
Create a new fake process response for testing purposes.
$this
fake(Closure|array|null $callback = null)
Indicate that the process factory should fake processes.
bool
isRecording()
Determine if the process factory has fake process handlers and is recording processes.
$this
recordIfRecording(PendingProcess $process, ProcessResult $result)
Record the given process if processes should be recorded.
$this
preventStrayProcesses(bool $prevent = true)
Indicate that an exception should be thrown if any process is not faked.
$this
assertRan(Closure|string $callback)
Assert that a process was recorded matching a given truth test.
$this
assertRanTimes(Closure|string $callback, int $times = 1)
Assert that a process was recorded a given number of times matching a given truth test.
$this
assertNotRan(Closure|string $callback)
Assert that a process was not recorded matching a given truth test.
$this
assertDidntRun(Closure|string $callback)
Assert that a process was not recorded matching a given truth test.
ProcessResult
pipe(callable|array $callback, callable|null $output = null)
Start defining a series of piped processes.
ProcessPoolResults
concurrently(callable $callback, callable|null $output = null)
Run a pool of processes and wait for them to finish executing.