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