FakesInputOutput
trait FakesInputOutput
Methods
Fake the terminal and queue key presses to be simulated.
Implementation of the looping mechanism for simulating key presses.
Assert that the output contains the given string.
Assert that the output doesn't contain the given string.
Assert that the stripped output contains the given string.
Assert that the stripped output doesn't contain the given string.
Get the buffered console output.
Get the buffered console output, stripped of escape sequences.
Details
at line 23
static void
fake(array $keys = [])
Fake the terminal and queue key presses to be simulated.
Tests only. Swaps prompt terminal and output state for the worker lifetime.
at line 60
static void
fakeKeyPresses(array $keys, callable $callable)
Implementation of the looping mechanism for simulating key presses.
By ignoring the $callable parameter which contains the default logic
for simulating fake key presses, we can use a custom implementation
to emit key presses instead, allowing us to use different inputs.
at line 70
static void
assertOutputContains(string $string)
Assert that the output contains the given string.
at line 78
static void
assertOutputDoesntContain(string $string)
Assert that the output doesn't contain the given string.
at line 86
static void
assertStrippedOutputContains(string $string)
Assert that the stripped output contains the given string.
at line 94
static void
assertStrippedOutputDoesntContain(string $string)
Assert that the stripped output doesn't contain the given string.
at line 102
static string
content()
Get the buffered console output.
at line 114
static string
strippedContent()
Get the buffered console output, stripped of escape sequences.