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 25
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 62
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 72
static void
assertOutputContains(string $string)
Assert that the output contains the given string.
at line 80
static void
assertOutputDoesntContain(string $string)
Assert that the output doesn't contain the given string.
at line 88
static void
assertStrippedOutputContains(string $string)
Assert that the stripped output contains the given string.
at line 96
static void
assertStrippedOutputDoesntContain(string $string)
Assert that the stripped output doesn't contain the given string.
at line 104
static string
content()
Get the buffered console output.
at line 116
static string
strippedContent()
Get the buffered console output, stripped of escape sequences.