class ConsoleOutputTest extends TestCase
{ public function testConstructorWithoutFormatter() { $output =
new ConsoleOutput(Output::VERBOSITY_QUIET, true
);
$this->
assertEquals(Output::VERBOSITY_QUIET,
$output->
getVerbosity(), '__construct() takes the verbosity as its first argument'
);
$this->
assertNotSame($output->
getFormatter(),
$output->
getErrorOutput()->
getFormatter(), 'ErrorOutput should use it own formatter'
);
} public function testConstructorWithFormatter() { $output =
new ConsoleOutput(Output::VERBOSITY_QUIET, true,
$formatter =
new OutputFormatter());
$this->
assertEquals(Output::VERBOSITY_QUIET,
$output->
getVerbosity(), '__construct() takes the verbosity as its first argument'
);
$this->
assertSame($formatter,
$output->
getFormatter());
$this->
assertSame($formatter,
$output->
getErrorOutput()->
getFormatter(), 'Output and ErrorOutput should use the same provided formatter'
);
} public function testSetFormatter() { $output =
new ConsoleOutput();
$outputFormatter =
new OutputFormatter();
$output->
setFormatter($outputFormatter);
$this->
assertSame($outputFormatter,
$output->
getFormatter());