OutputUtilsTrait
trait OutputUtilsTrait (View source)
OutputUtilsTrait provides some useful utility methods for test classes
that define getOutputRaw()
and getErrorOutputRaw()
methods.
This trait is used by CliTestTrait and DrushTestTrait.
Methods
Accessor for the last output, non-trimmed.
Accessor for the last stderr output, non-trimmed.
Get command output and simplify things like full paths and extra whitespace.
Returns a simplified version of the error output to facilitate testing.
Remove things like full paths and extra whitespace from the given string.
No description
Accessor for the last output, trimmed.
Accessor for the last stderr output, trimmed.
Accessor for the last output, rtrimmed and split on newlines.
Accessor for the last stderr output, rtrimmed and split on newlines.
Accessor for the last output, decoded from json.
Details
abstract string
getOutputRaw()
Accessor for the last output, non-trimmed.
abstract string
getErrorOutputRaw()
Accessor for the last stderr output, non-trimmed.
protected string
getSimplifiedOutput()
Get command output and simplify things like full paths and extra whitespace.
protected string
getSimplifiedErrorOutput()
Returns a simplified version of the error output to facilitate testing.
protected string
simplifyOutput(string $output)
Remove things like full paths and extra whitespace from the given string.
array
pathsToSimplify()
No description
string
getOutput()
Accessor for the last output, trimmed.
string
getErrorOutput()
Accessor for the last stderr output, trimmed.
array
getOutputAsList()
Accessor for the last output, rtrimmed and split on newlines.
array
getErrorOutputAsList()
Accessor for the last stderr output, rtrimmed and split on newlines.
mixed
getOutputFromJSON(string|int|null $key = null)
Accessor for the last output, decoded from json.