/** * @param resource $resource * @param string $text */ protected function doWrite($resource, $text) { if (true === $this->enableAnsi) { $text = $this->formatter->format($text); } else { $text = strip_tags($text); } fwrite($resource, $text); }
public function testInvalidFormatter() { $this->setExpectedException('\\Borobudur\\Console\\Exception\\InvalidArgumentException'); $formatter = new Formatter(); $formatter->format('<style name="wrong">info: </style><style name="info">Hello world</style>'); }