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 bool | $stopped | Indicates whether the process has been stopped. |
|
| protected Closure|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.
Get the command line for the process.
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.
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.
Stop the process if it is still running.
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
bool
hasReceivedSignal(int $signal)
Determine if the process has received the given signal.
at line 98
bool
running()
Determine if the process is still running.
at line 126
protected array|false
invokeOutputHandlerWithNextLineOfOutput()
Invoke the asynchronous output handler with the next single line of output if necessary.
at line 162
protected void
callOutputHandler(Closure $outputHandler, string $type, string $buffer)
Invoke the output handler for the given output.
at line 177
string
output()
Get the standard output for the process.
at line 195
string
errorOutput()
Get the error output for the process.
at line 213
string
latestOutput()
Get the latest standard output for the process.
at line 234
string
latestErrorOutput()
Get the latest error output for the process.
at line 255
void
ensureNotTimedOut()
Ensure that the process has not timed out.
at line 262
ProcessResult
wait(callable|null $output = null)
Wait for the process to finish.
at line 284
ProcessResult
waitUntil(callable|null $output = null)
Wait until the given callback returns true.
at line 309
int|null
stop(float $timeout = 10, int|null $signal = null)
Stop the process if it is still running.
at line 320
ProcessResult
predictProcessResult()
Get the ultimate process result that will be returned by this "process".
at line 328
FakeInvokedProcess
withOutputHandler(callable|null $outputHandler)
Set the general output handler for the fake invoked process.