Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Definition / Printer / ConsoleDefinitionListPrinter.php
1 <?php
2
3 /*
4  * This file is part of the Behat.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 namespace Behat\Behat\Definition\Printer;
12
13 use Behat\Testwork\Suite\Suite;
14
15 /**
16  * Prints simple definitions list.
17  *
18  * @author Konstantin Kudryashov <ever.zet@gmail.com>
19  */
20 final class ConsoleDefinitionListPrinter extends ConsoleDefinitionPrinter
21 {
22     /**
23      * {@inheritdoc}
24      */
25     public function printDefinitions(Suite $suite, $definitions)
26     {
27         $output = array();
28
29         foreach ($definitions as $definition) {
30             $definition = $this->translateDefinition($suite, $definition);
31
32             $output[] = strtr(
33                 '{suite} <def_dimmed>|</def_dimmed> <info>{type}</info> <def_regex>{regex}</def_regex>', array(
34                     '{suite}' => $suite->getName(),
35                     '{type}'  => $this->getDefinitionType($definition, true),
36                     '{regex}' => $definition->getPattern(),
37                 )
38             );
39         }
40
41         $this->write(rtrim(implode(PHP_EOL, $output)));
42     }
43 }