+
+ public function testGetErrorStyle()
+ {
+ $input = $this->getMockBuilder(InputInterface::class)->getMock();
+
+ $errorOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
+ $errorOutput
+ ->method('getFormatter')
+ ->willReturn(new OutputFormatter());
+ $errorOutput
+ ->expects($this->once())
+ ->method('write');
+
+ $output = $this->getMockBuilder(ConsoleOutputInterface::class)->getMock();
+ $output
+ ->method('getFormatter')
+ ->willReturn(new OutputFormatter());
+ $output
+ ->expects($this->once())
+ ->method('getErrorOutput')
+ ->willReturn($errorOutput);
+
+ $io = new SymfonyStyle($input, $output);
+ $io->getErrorStyle()->write('');
+ }
+
+ public function testGetErrorStyleUsesTheCurrentOutputIfNoErrorOutputIsAvailable()
+ {
+ $output = $this->getMockBuilder(OutputInterface::class)->getMock();
+ $output
+ ->method('getFormatter')
+ ->willReturn(new OutputFormatter());
+
+ $style = new SymfonyStyle($this->getMockBuilder(InputInterface::class)->getMock(), $output);
+
+ $this->assertInstanceOf(SymfonyStyle::class, $style->getErrorStyle());
+ }