PendingCommand
Properties
$command string
The command to run.
$parameters array
The parameters to pass to the command.
$expectedExitCode int
The expected exit code.
$unexpectedExitCode int
The unexpected exit code.
$hasExecuted bool
Determine if the command has executed.
Methods
__construct ( PHPUnit\...\TestCase $test , Container $app , $command , $parameters ) : void
Create a new pending console command run.
Parameters
- $test PHPUnit\...\TestCase
- $app Container
- $command string
- $parameters array
expectsQuestion ( $question , $answer ) : $this
Specify an expected question that will be asked when the command runs.
Parameters
- $question string
- $answer string|bool
expectsConfirmation ( $question , $answer ) : $this
Specify an expected confirmation question that will be asked when the command runs.
Parameters
- $question string
- $answer string
expectsChoice ( $question , $answer , $answers , $strict ) : $this
Specify an expected choice question with expected answers that will be asked/shown when the command runs.
Parameters
- $question string
- $answer string|array
- $answers array
- $strict bool
expectsOutput ( $output ) : $this
Specify output that should be printed when the command runs.
Parameters
- $output string
doesntExpectOutput ( $output ) : $this
Specify output that should never be printed when the command runs.
Parameters
- $output string
expectsOutputToContain ( $string ) : $this
Specify that the given string should be contained in the command output.
Parameters
- $string string
doesntExpectOutputToContain ( $string ) : $this
Specify that the given string shouldn't be contained in the command output.
Parameters
- $string string
expectsTable ( $headers , $rows , $tableStyle , array $columnStyles ) : $this
Specify a table that should be printed when the command runs.
Parameters
- $headers array
- $rows Illuminate\...\Arrayable|array
- $tableStyle string
- $columnStyles array
assertExitCode ( $exitCode ) : $this
Assert that the command has the given exit code.
Parameters
- $exitCode int
assertNotExitCode ( $exitCode ) : $this
Assert that the command does not have the given exit code.
Parameters
- $exitCode int
assertSuccessful ( ) : $this
Assert that the command has the success exit code.
assertOk ( ) : $this
Assert that the command has the success exit code.
assertFailed ( ) : $this
Assert that the command does not have the success exit code.
execute ( ) : int
Execute the command.
run ( ) : int
Execute the command.
verifyExpectations ( ) : void
Determine if expected questions / choices / outputs are fulfilled.
mockConsoleOutput ( ) : Mockery\MockInterface
Mock the application's console output.
createABufferedOutputMock ( ) : Mockery\MockInterface
Create a mock for the buffered output.
flushExpectations ( ) : void
Flush the expectations from the test case.
__destruct ( ) : void
Handle the object's destruction.