FakeOutputStyle
class FakeOutputStyle extends OutputStyle (View source)
| internal |
Properties
| protected int | $newLinesWritten | The number of trailing new lines written by the last output. |
from OutputStyle |
| protected bool deprecated | $newLineWritten | If the last output written wrote a new line. |
from OutputStyle |
| protected array<int, array{0: string, 1: mixed}> | $questions | The expected questions that have not been asked yet, as [question, answer] pairs. |
|
| protected Question> | $asked | The questions that were asked, keyed by their expected question text. |
|
| protected string|null | $failure | The failure from a question that should not have been asked. |
Methods
Create a new fake output style instance.
Answer the next expected question.
{@inheritdoc}
{@inheritdoc}
Count the number of trailing new lines in a string.
Get the message for the first unmet question expectation.
Get the expected choices with the choices that were actually offered.
Details
__construct(InputInterface $input, OutputInterface $output, array $questions = [], array $choices = [])
Create a new fake output style instance.
mixed
askQuestion(Question $question)
Answer the next expected question.
void
write(string|iterable $messages, bool $newline = false, int $options = 0)
{@inheritdoc}
void
writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL)
{@inheritdoc}
void
newLine(int $count = 1)
{@inheritdoc}
int
newLinesWritten()
How many trailing newlines were written.
bool
newLineWritten()
deprecated
deprecated
Whether a newline has already been written.
protected int
trailingNewLineCount(string|iterable<string> $messages)
Count the number of trailing new lines in a string.
bool
isQuiet()
Returns whether verbosity is quiet (-q).
bool
isVerbose()
Returns whether verbosity is verbose (-v).
bool
isVeryVerbose()
Returns whether verbosity is very verbose (-vv).
bool
isDebug()
Returns whether verbosity is debug (-vvv).
OutputInterface
getOutput()
Get the underlying Symfony output implementation.
string|null
failure()
Get the message for the first unmet question expectation.
array<string, array{expected: array, strict: bool, actual: array|null}>
choices()
Get the expected choices with the choices that were actually offered.