Class ConsoleInput

Stub class used by the console integration harness.

This class enables input to be stubbed and have exceptions raised when no answer is available.

Cake\Console\ConsoleInput
Extended by Cake\TestSuite\Stub\ConsoleInput

Properties summary

  • $currentIndex protected
    integer
    Current message index
  • $replies protected
    array
    Reply values for ask() and askChoice()

Inherited Properties

Method Summary

Method Detail

__construct()source public

__construct( array $replies )

Constructor

Parameters

array $replies
A list of replies for read()

Overrides

Cake\Console\ConsoleInput::__construct()

dataAvailable()source public

dataAvailable( integer $timeout = 0 )

Check if data is available on stdin

Parameters

integer $timeout optional 0
An optional time to wait for data

Returns

boolean
True for data available, false otherwise

Overrides

Cake\Console\ConsoleInput::dataAvailable()

read()source public

read( )

Read a reply

Returns

mixed
The value of the reply

Overrides

Cake\Console\ConsoleInput::read()

Properties detail

$currentIndexsource

protected integer

Current message index

-1

$repliessource

protected array

Reply values for ask() and askChoice()

[]

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.8/class-Cake.TestSuite.Stub.ConsoleInput.html