public function testNewStyle() { $formatter = new OutputFormatter(true); $style = new OutputFormatterStyle('blue', 'white'); $formatter->setStyle('test', $style); $this->assertEquals($style, $formatter->getStyle('test')); $this->assertNotEquals($style, $formatter->getStyle('info')); $this->assertEquals("[34;47msome custom msg[0m", $formatter->format('<test>some custom msg</test>')); }
public function testNewStyle() { $formatter = new OutputFormatter(true); $style = $this->getMockBuilder('Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface')->getMock(); $formatter->setStyle('test', $style); $this->assertEquals($style, $formatter->getStyle('test')); $this->assertNotEquals($style, $formatter->getStyle('info')); $style->expects($this->once())->method('apply')->will($this->returnValue('[STYLE_BEG]some custom msg[STYLE_END]')); $this->assertEquals("[STYLE_BEG]some custom msg[STYLE_END]", $formatter->format('<test>some custom msg</test>')); }