class Illuminate / Testing / PendingCommand
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

PendingCommand

Properties

public

$test TestCase

The test being run.

Default: null
protected

$app Container

The application instance.

Default: null
protected

$command string

The command to run.

Default: null
protected

$parameters array

The parameters to pass to the command.

Default: null
protected

$expectedExitCode int

The expected exit code.

Default: null
protected

$unexpectedExitCode int

The unexpected exit code.

Default: null
protected

$hasExecuted bool

Determine if the command has executed.

Default: false

Methods

public

__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
public

expectsQuestion ( $question , $answer ) : $this

Specify an expected question that will be asked when the command runs.

Parameters

  • $question string
  • $answer string|bool
public

expectsConfirmation ( $question , $answer ) : $this

Specify an expected confirmation question that will be asked when the command runs.

Parameters

  • $question string
  • $answer string
public

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
public

expectsOutput ( $output ) : $this

Specify output that should be printed when the command runs.

Parameters

  • $output string
public

doesntExpectOutput ( $output ) : $this

Specify output that should never be printed when the command runs.

Parameters

  • $output string
public

expectsOutputToContain ( $string ) : $this

Specify that the given string should be contained in the command output.

Parameters

  • $string string
public

doesntExpectOutputToContain ( $string ) : $this

Specify that the given string shouldn't be contained in the command output.

Parameters

  • $string string
public

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
public

assertExitCode ( $exitCode ) : $this

Assert that the command has the given exit code.

Parameters

  • $exitCode int
public

assertNotExitCode ( $exitCode ) : $this

Assert that the command does not have the given exit code.

Parameters

  • $exitCode int
public

assertSuccessful ( ) : $this

Assert that the command has the success exit code.

public

assertOk ( ) : $this

Assert that the command has the success exit code.

public

assertFailed ( ) : $this

Assert that the command does not have the success exit code.

public

execute ( ) : int

Execute the command.

public

run ( ) : int

Execute the command.

protected

verifyExpectations ( ) : void

Determine if expected questions / choices / outputs are fulfilled.

protected

mockConsoleOutput ( ) : Mockery\MockInterface

Mock the application's console output.

private

createABufferedOutputMock ( ) : Mockery\MockInterface

Create a mock for the buffered output.

protected

flushExpectations ( ) : void

Flush the expectations from the test case.

public

__destruct ( ) : void

Handle the object's destruction.