22 $this->assertEquals(
Output::VERBOSITY_QUIET, $output->getVerbosity(),
'__construct() takes the verbosity as its first argument');
23 $this->assertTrue($output->isDecorated(),
'__construct() takes the decorated flag as its second argument');
29 $output->setDecorated(
true);
30 $this->assertTrue($output->isDecorated(),
'setDecorated() sets the decorated flag');
39 $this->assertTrue($output->isQuiet());
40 $this->assertFalse($output->isVerbose());
41 $this->assertFalse($output->isVeryVerbose());
42 $this->assertFalse($output->isDebug());
45 $this->assertFalse($output->isQuiet());
46 $this->assertFalse($output->isVerbose());
47 $this->assertFalse($output->isVeryVerbose());
48 $this->assertFalse($output->isDebug());
51 $this->assertFalse($output->isQuiet());
52 $this->assertTrue($output->isVerbose());
53 $this->assertFalse($output->isVeryVerbose());
54 $this->assertFalse($output->isDebug());
57 $this->assertFalse($output->isQuiet());
58 $this->assertTrue($output->isVerbose());
59 $this->assertTrue($output->isVeryVerbose());
60 $this->assertFalse($output->isDebug());
63 $this->assertFalse($output->isQuiet());
64 $this->assertTrue($output->isVerbose());
65 $this->assertTrue($output->isVeryVerbose());
66 $this->assertTrue($output->isDebug());
72 $output->writeln(
'foo');
73 $this->assertEquals(
'', $output->output,
'->writeln() outputs nothing if verbosity is set to VERBOSITY_QUIET');
79 $output->writeln(array(
'foo',
'bar'));
80 $this->assertEquals(
"foo\nbar\n", $output->output,
'->writeln() can take an array of messages to output');
89 $output->writeln($message, $type);
90 $this->assertEquals($expectedOutput, $output->output);
104 $output->setDecorated(
false);
105 $output->writeln(
'<info>foo</info>');
106 $this->assertEquals(
"foo\n", $output->output,
'->writeln() strips decoration tags if decoration is set to false');
113 $output->getFormatter()->setStyle(
'FOO', $fooStyle);
114 $output->setDecorated(
true);
115 $output->writeln(
'<foo>foo</foo>');
116 $this->assertEquals(
"\033[33;41;5mfoo\033[39;49;25m\n", $output->output,
'->writeln() decorates the output');
126 $output->writeln(
'<foo>foo</foo>', 24);
134 $output->write(
'<bar>foo</bar>');
135 $this->assertEquals(
'<bar>foo</bar>', $output->output,
'->write() do nothing when a style does not exist');
138 $output->writeln(
'<bar>foo</bar>');
139 $this->assertEquals(
"<bar>foo</bar>\n", $output->output,
'->writeln() do nothing when a style does not exist');
152 protected function doWrite($message, $newline)
154 $this->output .= $message.($newline ?
"\n" :
'');