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 80
InvokedProcess
signal(int $signal)
Send a signal to the process.
at line 92
bool
hasReceivedSignal(int $signal)
Determine if the process has received the given signal.
at line 100
bool
running()
Determine if the process is still running.
at line 128
protected array|false
invokeOutputHandlerWithNextLineOfOutput()
Invoke the asynchronous output handler with the next single line of output if necessary.
at line 164
protected void
callOutputHandler(Closure $outputHandler, string $type, string $buffer)
Invoke the output handler for the given output.
at line 179
string
output()
Get the standard output for the process.
at line 197
string
errorOutput()
Get the error output for the process.
at line 215
string
latestOutput()
Get the latest standard output for the process.
at line 236
string
latestErrorOutput()
Get the latest error output for the process.
at line 257
void
ensureNotTimedOut()
Ensure that the process has not timed out.
at line 264
ProcessResult
wait(callable|null $output = null)
Wait for the process to finish.
at line 286
ProcessResult
waitUntil(callable|null $output = null)
Wait until the given callback returns true.
at line 311
int|null
stop(float $timeout = 10, int|null $signal = null)
Stop the process if it is still running.
at line 322
ProcessResult
predictProcessResult()
Get the ultimate process result that will be returned by this "process".
at line 332
FakeInvokedProcess
withOutputHandler(callable|null $outputHandler)
Set the general output handler for the fake invoked process.