Documentation

TesterTrait

Tags
author

Amrouche Hamza hamza.simperfit@gmail.com

Table of Contents

Properties

$captureStreamsIndependently  : bool
$input  : InputInterface
$inputs  : array<string|int, mixed>
$output  : StreamOutput
$statusCode  : int

Methods

assertCommandIsSuccessful()  : void
getDisplay()  : string
Gets the display returned by the last execution of the command or application.
getErrorOutput()  : string
Gets the output written to STDERR by the application.
getInput()  : InputInterface
Gets the input instance used by the last execution of the command or application.
getOutput()  : OutputInterface
Gets the output instance used by the last execution of the command or application.
getStatusCode()  : int
Gets the status code returned by the last execution of the command or application.
setInputs()  : $this
Sets the user inputs.
createStream()  : resource
initOutput()  : void
Initializes the output property.

Properties

$captureStreamsIndependently

private bool $captureStreamsIndependently = false

$inputs

private array<string|int, mixed> $inputs = []

Methods

assertCommandIsSuccessful()

public assertCommandIsSuccessful([string $message = '' ]) : void
Parameters
$message : string = ''

getDisplay()

Gets the display returned by the last execution of the command or application.

public getDisplay([bool $normalize = false ]) : string
Parameters
$normalize : bool = false
Tags
throws
RuntimeException

If it's called before the execute method

Return values
string

getErrorOutput()

Gets the output written to STDERR by the application.

public getErrorOutput([bool $normalize = false ]) : string
Parameters
$normalize : bool = false

Whether to normalize end of lines to \n or not

Return values
string

getStatusCode()

Gets the status code returned by the last execution of the command or application.

public getStatusCode() : int
Tags
throws
RuntimeException

If it's called before the execute method

Return values
int

setInputs()

Sets the user inputs.

public setInputs(array<string|int, mixed> $inputs) : $this
Parameters
$inputs : array<string|int, mixed>

An array of strings representing each input passed to the command input stream

Return values
$this

createStream()

private static createStream(array<string|int, mixed> $inputs) : resource
Parameters
$inputs : array<string|int, mixed>
Return values
resource

initOutput()

Initializes the output property.

private initOutput(array<string|int, mixed> $options) : void

Available options:

  • decorated: Sets the output decorated flag
  • verbosity: Sets the output verbosity flag
  • capture_stderr_separately: Make output of stdOut and stdErr separately available
Parameters
$options : array<string|int, mixed>

        
On this page

Search results