X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FSnippet%2FPrinter%2FConsoleSnippetPrinter.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FSnippet%2FPrinter%2FConsoleSnippetPrinter.php;h=0000000000000000000000000000000000000000;hp=7a5b36e74f951d3f83aca82547f182c89b457667;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/behat/src/Behat/Behat/Snippet/Printer/ConsoleSnippetPrinter.php b/vendor/behat/behat/src/Behat/Behat/Snippet/Printer/ConsoleSnippetPrinter.php deleted file mode 100644 index 7a5b36e74..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Snippet/Printer/ConsoleSnippetPrinter.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\Snippet\Printer; - -use Behat\Behat\Snippet\AggregateSnippet; -use Behat\Gherkin\Node\StepNode; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Translation\TranslatorInterface; - -/** - * Behat console-based snippet printer. - * - * Extends default printer with default styles. - * - * @author Konstantin Kudryashov - */ -class ConsoleSnippetPrinter implements SnippetPrinter -{ - /** - * @var OutputInterface - */ - private $output; - /** - * @var TranslatorInterface - */ - private $translator; - - /** - * Initializes printer. - * - * @param OutputInterface $output - * @param TranslatorInterface $translator - */ - public function __construct(OutputInterface $output, TranslatorInterface $translator) - { - $this->output = $output; - $this->translator = $translator; - - $output->getFormatter()->setStyle('snippet_keyword', new OutputFormatterStyle(null, null, array('bold'))); - $output->getFormatter()->setStyle('snippet_undefined', new OutputFormatterStyle('yellow')); - } - - /** - * Prints snippets of specific target. - * - * @param string $targetName - * @param AggregateSnippet[] $snippets - */ - public function printSnippets($targetName, array $snippets) - { - $message = $this->translator->trans('snippet_proposal_title', array('%1%' => $targetName), 'output'); - - $this->output->writeln('--- ' . $message . PHP_EOL); - - foreach ($snippets as $snippet) { - $this->output->writeln(sprintf('%s', $snippet->getSnippet()) . PHP_EOL); - } - } - - /** - * Prints undefined steps of specific suite. - * - * @param string $suiteName - * @param StepNode[] $steps - */ - public function printUndefinedSteps($suiteName, array $steps) - { - $message = $this->translator->trans('snippet_missing_title', array('%1%' => $suiteName), 'output'); - - $this->output->writeln('--- ' . $message . PHP_EOL); - - foreach ($steps as $step) { - $this->output->writeln(sprintf(' %s %s', $step->getKeyword(), $step->getText())); - } - - $this->output->writeln(''); - } -}