示例#1
0
 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'));
     $style = new OutputFormatterStyle('blue', 'white');
     $formatter->setStyle('b', $style);
     $this->assertEquals("some custom msg", $formatter->format('<test>some <b>custom</b> msg</test>'));
 }