Factory
Uses
Properties
$recording bool
Indicates if the process factory has faked process handlers.
$recorded array
All of the recorded processes.
$fakeHandlers array
The registered fake handler callbacks.
$preventStrayProcesses bool
Indicates that an exception should be thrown if any process is not faked.
Methods
result ( $output , $errorOutput , int $exitCode ) : FakeProcessResult
Create a new fake process response for testing purposes.
Parameters
- $output array|string
- $errorOutput array|string
- $exitCode int
sequence ( array $processes ) : FakeProcessSequence
Begin describing a fake process sequence.
Parameters
- $processes array
fake ( $callback ) : $this
Indicate that the process factory should fake processes.
Parameters
- $callback Closure |array|null
isRecording ( ) : bool
Determine if the process factory has fake process handlers and is recording processes.
recordIfRecording ( PendingProcess $process , ProcessResult $result ) : $this
Record the given process if processes should be recorded.
Parameters
- $process PendingProcess
- $result ProcessResult
record ( PendingProcess $process , ProcessResult $result ) : $this
Record the given process.
Parameters
- $process PendingProcess
- $result ProcessResult
preventStrayProcesses ( bool $prevent ) : $this
Indicate that an exception should be thrown if any process is not faked.
Parameters
- $prevent bool
preventingStrayProcesses ( ) : bool
Determine if stray processes are being prevented.
assertRan ( $callback ) : $this
Assert that a process was recorded matching a given truth test.
Parameters
- $callback Closure |string
assertRanTimes ( $callback , int $times ) : $this
Assert that a process was recorded a given number of times matching a given truth test.
Parameters
- $callback Closure |string
- $times int
assertNotRan ( $callback ) : $this
Assert that a process was not recorded matching a given truth test.
Parameters
- $callback Closure |string
assertDidntRun ( $callback ) : $this
Assert that a process was not recorded matching a given truth test.
Parameters
- $callback Closure |string
assertNothingRan ( ) : $this
Assert that no processes were recorded.
pool ( callable $callback ) : Pool
Start defining a pool of processes.
Parameters
- $callback callable
pipe ( $callback , callable $output ) : ProcessResult
Start defining a series of piped processes.
Parameters
- $callback callable|array
concurrently ( callable $callback , callable $output ) : ProcessPoolResults
Run a pool of processes and wait for them to finish executing.
Parameters
- $callback callable
- $output callable|null
newPendingProcess ( ) : PendingProcess
Create a new pending process associated with this factory.
__call ( $method , $parameters ) : mixed
Dynamically proxy methods to a new pending process instance.
Parameters
- $method string
- $parameters array