ProcessResult
final class ProcessResult
| internal |
Process result with additional passthrough methods for testbench.
Traits
Properties
| protected array<int, string> | $passthru | The methods that should be forwarded to the process instance. |
Methods
Forward a method call to the given object.
Forward a method call to the given object, returning $this if the forwarded call returned itself.
Throw a bad method call exception for the given method.
Get the original command executed by the process.
Determine if the process was successful.
Determine if the process failed.
Get the exit code of the process.
Get the standard output of the process.
Determine if the output contains the given string.
Get the error output of the process.
Determine if the error output contains the given string.
Throw an exception if the process failed.
Throw an exception if the process failed and the given condition is true.
Handle dynamic calls to the process instance.
Details
in
ForwardsCalls at line 22
protected mixed
forwardCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object.
in
ForwardsCalls at line 52
protected mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object, returning $this if the forwarded call returned itself.
in
ForwardsCalls at line 66
static protected never
throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method.
at line 44
__construct(Process $process, Closure|array|string $command)
Create a new process result instance.
at line 53
string
command()
Get the original command executed by the process.
at line 61
bool
successful()
Determine if the process was successful.
at line 69
bool
failed()
Determine if the process failed.
at line 77
int|null
exitCode()
Get the exit code of the process.
at line 87
mixed
output()
Get the standard output of the process.
at line 161
bool
seeInOutput(string $output)
Determine if the output contains the given string.
at line 169
string
errorOutput()
Get the error output of the process.
at line 177
bool
seeInErrorOutput(string $output)
Determine if the error output contains the given string.
at line 185
ProcessResult
throw(callable|null $callback = null)
Throw an exception if the process failed.
at line 203
ProcessResult
throwIf(bool $condition, callable|null $callback = null)
Throw an exception if the process failed and the given condition is true.
at line 217
mixed
__call(string $method, array $parameters)
Handle dynamic calls to the process instance.