Class StubConsoleInput
Stub class used by the console integration harness.
This class enables input to be stubbed and have exceptions raised when no answer is available.
Namespace: Cake\Console\TestSuite
Property Summary
-
$_canReadline protected
bool
Can this instance use readline? Two conditions must be met:
- Readline support must be enabled.
- Handle we are attached to must be stdin. Allows rich editing with arrow keys and history when inputting a string.
-
$_input protected
resource
Input value.
-
$currentIndex protected
int
Current message index
-
$replies protected
array<string>
Reply values for ask() and askChoice()
Method Summary
-
__construct() public
Constructor
-
__destruct() public
Destruct and free resources
-
dataAvailable() public
Check if data is available on stdin
-
read() public
Read a reply
Method Detail
__construct() ¶ public
__construct(array<string> $replies)
Constructor
Parameters
-
array<string>
$replies A list of replies for read()
dataAvailable() ¶ public
dataAvailable(int $timeout = 0): bool
Check if data is available on stdin
Parameters
-
int
$timeout optional An optional time to wait for data
Returns
bool
Property Detail
$_canReadline ¶ protected
Can this instance use readline? Two conditions must be met:
- Readline support must be enabled.
- Handle we are attached to must be stdin. Allows rich editing with arrow keys and history when inputting a string.
Type
bool