X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FOutput%2FPrinter%2FConsoleOutputFactory.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FOutput%2FPrinter%2FConsoleOutputFactory.php;h=4764e17720b339787e3a9e4c9a4ffea6feb6f9c8;hb=1270d9129ce8f27c9b28b10518e32132c58e0aca;hp=0000000000000000000000000000000000000000;hpb=c27c0f0cdaa3f354b1fe54a56ae7e854be6e3f68;p=yaffs-website diff --git a/vendor/behat/behat/src/Behat/Behat/Output/Printer/ConsoleOutputFactory.php b/vendor/behat/behat/src/Behat/Behat/Output/Printer/ConsoleOutputFactory.php new file mode 100644 index 000000000..4764e1772 --- /dev/null +++ b/vendor/behat/behat/src/Behat/Behat/Output/Printer/ConsoleOutputFactory.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Behat\Behat\Output\Printer; + +use Behat\Behat\Output\Printer\Formatter\ConsoleFormatter; +use Behat\Testwork\Output\Printer\Factory\ConsoleOutputFactory as BaseFactory; +use Symfony\Component\Console\Formatter\OutputFormatterStyle; + +/** + * Extends default printer with default styles. + * + * @author Konstantin Kudryashov + */ +final class ConsoleOutputFactory extends BaseFactory +{ + /** + * {@inheritDoc} + */ + protected function createOutputFormatter() + { + $formatter = new ConsoleFormatter($this->isOutputDecorated()); + + foreach ($this->getDefaultStyles() as $name => $style) { + $formatter->setStyle($name, $style); + } + + return $formatter; + } + + /** + * Returns default styles. + * + * @return OutputFormatterStyle[string] + */ + private function getDefaultStyles() + { + return array( + 'keyword' => new OutputFormatterStyle(null, null, array('bold')), + 'stdout' => new OutputFormatterStyle(null, null, array()), + 'exception' => new OutputFormatterStyle('red'), + 'undefined' => new OutputFormatterStyle('yellow'), + 'pending' => new OutputFormatterStyle('yellow'), + 'pending_param' => new OutputFormatterStyle('yellow', null, array('bold')), + 'failed' => new OutputFormatterStyle('red'), + 'failed_param' => new OutputFormatterStyle('red', null, array('bold')), + 'passed' => new OutputFormatterStyle('green'), + 'passed_param' => new OutputFormatterStyle('green', null, array('bold')), + 'skipped' => new OutputFormatterStyle('cyan'), + 'skipped_param' => new OutputFormatterStyle('cyan', null, array('bold')), + 'comment' => new OutputFormatterStyle('black'), + 'tag' => new OutputFormatterStyle('cyan') + ); + } +}