4 * This file is part of the Behat.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Behat\Output\Printer;
13 use Behat\Behat\Output\Printer\Formatter\ConsoleFormatter;
14 use Behat\Testwork\Output\Printer\Factory\ConsoleOutputFactory as BaseFactory;
15 use Symfony\Component\Console\Formatter\OutputFormatterStyle;
18 * Extends default printer with default styles.
20 * @author Konstantin Kudryashov <ever.zet@gmail.com>
22 final class ConsoleOutputFactory extends BaseFactory
27 protected function createOutputFormatter()
29 $formatter = new ConsoleFormatter($this->isOutputDecorated());
31 foreach ($this->getDefaultStyles() as $name => $style) {
32 $formatter->setStyle($name, $style);
39 * Returns default styles.
41 * @return OutputFormatterStyle[string]
43 private function getDefaultStyles()
46 'keyword' => new OutputFormatterStyle(null, null, array('bold')),
47 'stdout' => new OutputFormatterStyle(null, null, array()),
48 'exception' => new OutputFormatterStyle('red'),
49 'undefined' => new OutputFormatterStyle('yellow'),
50 'pending' => new OutputFormatterStyle('yellow'),
51 'pending_param' => new OutputFormatterStyle('yellow', null, array('bold')),
52 'failed' => new OutputFormatterStyle('red'),
53 'failed_param' => new OutputFormatterStyle('red', null, array('bold')),
54 'passed' => new OutputFormatterStyle('green'),
55 'passed_param' => new OutputFormatterStyle('green', null, array('bold')),
56 'skipped' => new OutputFormatterStyle('cyan'),
57 'skipped_param' => new OutputFormatterStyle('cyan', null, array('bold')),
58 'comment' => new OutputFormatterStyle('black'),
59 'tag' => new OutputFormatterStyle('cyan')