Skip to content

CommandTest ​

Type
Class
Namespace
craft\test\console
Inherits
craft\test\console\CommandTest
Since
3.2.0

Class ConsoleTest

View source

Protected Properties ​

PropertyDescription
actionIdstring
commandstring
controllercraft\console\Controller
currentIndexinteger
desiredExitCodeinteger
eventChainarray, craft\test\console\CommandTestItem
eventChainItemsHandledinteger
expectedExitCodeinteger
hasExecutedboolean
ignoreStdoutboolean
parametersarray
testcraft\test\console\ConsoleTest

actionId ​

Type
string
Default value
null

View source

command ​

Type
string
Default value
null

View source

controller ​

Type
craft\console\Controller
Default value
null

View source

currentIndex ​

Type
integer
Default value
null

View source

desiredExitCode ​

Type
integer
Default value
null

View source

eventChain ​

Type
array, craft\test\console\CommandTestItem
Default value
[]

View source

eventChainItemsHandled ​

Type
integer
Default value
0

View source

expectedExitCode ​

Type
integer
Default value
null

View source

hasExecuted ​

Type
boolean
Default value
false

View source

ignoreStdout ​

Type
boolean
Default value
false

View source

parameters ​

Type
array
Default value
null

View source

test ​

Type
craft\test\console\ConsoleTest
Default value
null

View source

Public Methods ​

MethodDescription
__construct()CommandTest constructor.
confirm()
exitCode()
outputCommand()
prompt()
run()
select()
stderr()
stdout()

__construct() ​

CommandTest constructor.

View source

Arguments ​

Throws ​

confirm() ​

View source

Arguments ​

Returns ​

craft\test\console\CommandTest

exitCode() ​

View source

Arguments ​

Returns ​

craft\test\console\CommandTest

outputCommand() ​

View source

Arguments ​

Returns ​

craft\test\console\CommandTest

prompt() ​

View source

Arguments ​

Returns ​

craft\test\console\CommandTest

run() ​

View source

Throws ​

select() ​

View source

Arguments ​

Returns ​

craft\test\console\CommandTest

stderr() ​

View source

Arguments ​

  • $desiredOutput (iterable, string)

Returns ​

craft\test\console\CommandTest

stdout() ​

View source

Arguments ​

  • $desiredOutput (iterable, string)

Returns ​

craft\test\console\CommandTest

Protected Methods ​

MethodDescription
addEventChainItem()
confirmHandler()
getNextItem()
outputCommandHandler()
promptHandler()
runHandlerCheck()
selectHandler()
setupController()
stderrHandler()
stdoutHandler()

addEventChainItem() ​

View source

Arguments ​

Returns ​

craft\test\console\CommandTest

confirmHandler() ​

View source

Returns ​

callable

getNextItem() ​

View source

Returns ​

craft\test\console\CommandTestItem, null

outputCommandHandler() ​

View source

Returns ​

callable

promptHandler() ​

View source

Returns ​

callable

runHandlerCheck() ​

View source

Arguments ​

Returns ​

craft\test\console\CommandTestItem

selectHandler() ​

View source

Returns ​

callable

setupController() ​

View source

Throws ​

stderrHandler() ​

View source

Returns ​

callable

stdoutHandler() ​

View source

Returns ​

callable

Constants ​

ConstantDescription
CONFIRM
OUTPUT_COMMAND
PROMPT
SELECT
STD_ERR
STD_OUT