FakeInvokedProcess
class FakeInvokedProcess implements InvokedProcess
Properties
| protected array<int, int> | $receivedSignals | The signals that have been received. |
|
| protected int|null | $remainingRunIterations | The number of times the process should indicate that it is "running". |
|
| protected Closure|null | $outputHandler | The general output handler callback. |
|
| protected bool | $outputHandlerFailed | Indicates that the output handler has failed. |
|
| 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.
Get the command line for the process.
Send a signal to the process.
Stop the process if it is still running.
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.
Invoke the output handler for the given output.
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.
Ensure that the process has not timed out.
Wait for the process to finish.
Wait until the given callback returns true.
Get the ultimate process result that will be returned by this "process".
Set the general output handler for the fake invoked process.
Details
at line 49
__construct(string $command, FakeProcessDescription $process)
Create a new invoked process instance.
at line 58
int|null
id()
Get the process ID if the process is still running.
at line 70
string
command()
Get the command line for the process.
at line 78
InvokedProcess
signal(int $signal)
Send a signal to the process.
at line 90
int|null
stop(float $timeout = 10, int|null $signal = null)
Stop the process if it is still running.
at line 100
bool
hasReceivedSignal(int $signal)
Determine if the process has received the given signal.
at line 108
bool
running()
Determine if the process is still running.
at line 132
protected array|false
invokeOutputHandlerWithNextLineOfOutput()
Invoke the asynchronous output handler with the next single line of output if necessary.
at line 168
protected void
callOutputHandler(Closure $outputHandler, string $type, string $buffer)
Invoke the output handler for the given output.
at line 184
string
output()
Get the standard output for the process.
at line 202
string
errorOutput()
Get the error output for the process.
at line 220
string
latestOutput()
Get the latest standard output for the process.
at line 241
string
latestErrorOutput()
Get the latest error output for the process.
at line 262
void
ensureNotTimedOut()
Ensure that the process has not timed out.
at line 269
ProcessResult
wait(callable|null $output = null)
Wait for the process to finish.
at line 291
ProcessResult
waitUntil(callable|null $output = null)
Wait until the given callback returns true.
at line 316
ProcessResult
predictProcessResult()
Get the ultimate process result that will be returned by this "process".
at line 324
FakeInvokedProcess
withOutputHandler(callable|null $outputHandler)
Set the general output handler for the fake invoked process.