On this page
FakeProcessResult
class FakeProcessResult implements ProcessResult (View source)
Properties
| protected string | $command | The command string.  | 
      |
| protected int | $exitCode | The process exit code.  | 
      |
| protected string | $output | The process output.  | 
      |
| protected string | $errorOutput | The process error output.  | 
      
Methods
| void | __construct(string $command = '', int $exitCode = 0, array|string $output = '', array|string $errorOutput = '')  Create a new process result instance.  | 
      |
| string | normalizeOutput(array|string $output)  Normalize the given output into a string with newlines.  | 
      |
| string | command()  Get the original command executed by the process.  | 
      |
| FakeProcessResult | withCommand(string $command)  Create a new fake process result with the given command.  | 
      |
| bool | successful()  Determine if the process was successful.  | 
      |
| bool | failed()  Determine if the process failed.  | 
      |
| int|null | exitCode()  Get the exit code of the process.  | 
      |
| string | output()  Get the standard output of the process.  | 
      |
| bool | seeInOutput(string $output)  Determine if the output contains the given string.  | 
      |
| string | errorOutput()  Get the error output of the process.  | 
      |
| bool | seeInErrorOutput(string $output)  Determine if the error output contains the given string.  | 
      |
| $this | throw(callable $callback = null)  Throw an exception if the process failed.  | 
      |
| $this | throwIf(bool $condition, callable $callback = null)  Throw an exception if the process failed and the given condition is true.  | 
      
Details
void __construct(string $command = '', int $exitCode = 0, array|string $output = '', array|string $errorOutput = '')
Create a new process result instance.
protected string normalizeOutput(array|string $output)
Normalize the given output into a string with newlines.
string command()
Get the original command executed by the process.
FakeProcessResult withCommand(string $command)
Create a new fake process result with the given command.
bool successful()
Determine if the process was successful.
bool failed()
Determine if the process failed.
int|null exitCode()
Get the exit code of the process.
string output()
Get the standard output of the process.
bool seeInOutput(string $output)
Determine if the output contains the given string.
string errorOutput()
Get the error output of the process.
bool seeInErrorOutput(string $output)
Determine if the error output contains the given string.
$this throw(callable $callback = null)
Throw an exception if the process failed.
$this throwIf(bool $condition, callable $callback = null)
Throw an exception if the process failed and the given condition is true.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
 https://laravel.com/api/10.x/Illuminate/Process/FakeProcessResult.html