FakeInvokedProcess
Implements
Properties
$command string
The command being faked.
$receivedSignals array
The signals that have been received.
$remainingRunIterations int|null
The number of times the process should indicate that it is "running".
$outputHandler callable|null
The general output handler callback.
$nextOutputIndex int
The current output's index.
$nextErrorOutputIndex int
The current error output's index.
Methods
__construct ( string $command , FakeProcessDescription $process ) : void
Create a new invoked process instance.
Parameters
- $command string
- $process FakeProcessDescription
id ( ) : int|null
Get the process ID if the process is still running.
signal ( int $signal ) : $this
Send a signal to the process.
Parameters
- $signal int
hasReceivedSignal ( int $signal ) : bool
Determine if the process has received the given signal.
Parameters
- $signal int
running ( ) : bool
Determine if the process is still running.
invokeOutputHandlerWithNextLineOfOutput ( ) : array|false
Invoke the asynchronous output handler with the next single line of output if necessary.
output ( ) : string
Get the standard output for the process.
errorOutput ( ) : string
Get the error output for the process.
latestOutput ( ) : string
Get the latest standard output for the process.
latestErrorOutput ( ) : string
Get the latest error output for the process.
wait ( callable $output ) : ProcessResult
Wait for the process to finish.
Parameters
- $output callable|null
predictProcessResult ( ) : ProcessResult
Get the ultimate process result that wil be returned by this "process".
withOutputHandler ( callable $outputHandler ) : $this
Set the general output handler for the fake invoked process.
Parameters
- $output callable|null