class
Illuminate
/
Process
/
FakeProcessResult
FakeProcessResult
Implements
Properties
protected
$command string
The command string.
Default: null
protected
$exitCode int
The process exit code.
Default: null
protected
$output string
The process output.
Default: ''
protected
$errorOutput string
The process error output.
Default: ''
Methods
public
__construct ( string $command , int $exitCode , $output , $errorOutput ) : void
Create a new process result instance.
Parameters
- $command string
- $exitCode int
- $output array|string
- $errorOutput array|string
protected
normalizeOutput ( $output ) : string
Normalize the given output into a string with newlines.
Parameters
- $output array|string
public
command ( ) : string
Get the original command executed by the process.
public
withCommand ( string $command ) : self
Create a new fake process result with the given command.
Parameters
- $command string
public
successful ( ) : bool
Determine if the process was successful.
public
failed ( ) : bool
Determine if the process failed.
public
exitCode ( ) : int
Get the exit code of the process.
public
output ( ) : string
Get the standard output of the process.
public
seeInOutput ( string $output ) : bool
Determine if the output contains the given string.
Parameters
- $output string
public
errorOutput ( ) : string
Get the error output of the process.
public
seeInErrorOutput ( string $output ) : bool
Determine if the error output contains the given string.
Parameters
- $output string
public
throw ( callable $callback ) : $this
Throw an exception if the process failed.
Parameters
- $callback callable|null
public
throwIf ( bool $condition , callable $callback ) : $this
Throw an exception if the process failed and the given condition is true.
Parameters
- $condition bool
- $callback callable|null