Security update for permissions_by_term
[yaffs-website] / vendor / behat / gherkin / tests / Behat / Gherkin / Keywords / ArrayKeywordsTest.php
1 <?php
2
3 namespace Tests\Behat\Gherkin\Keywords;
4
5 use Behat\Gherkin\Keywords\ArrayKeywords;
6 use Behat\Gherkin\Node\StepNode;
7
8 class ArrayKeywordsTest extends KeywordsTest
9 {
10     protected function getKeywords()
11     {
12         return new ArrayKeywords($this->getKeywordsArray());
13     }
14
15     protected function getKeywordsArray()
16     {
17         return array(
18             'with_special_chars' => array(
19                 'and' => 'And/foo',
20                 'background' => 'Background.',
21                 'but' => 'But[',
22                 'examples' => 'Examples|Scenarios',
23                 'feature' => 'Feature|Business Need|Ability',
24                 'given' => 'Given',
25                 'name' => 'English',
26                 'native' => 'English',
27                 'scenario' => 'Scenario',
28                 'scenario_outline' => 'Scenario Outline|Scenario Template',
29                 'then' => 'Then',
30                 'when' => 'When',
31             ),
32         );
33     }
34
35     protected function getSteps($keywords, $text, &$line, $keywordType)
36     {
37         $steps = array();
38         foreach (explode('|', $keywords) as $keyword) {
39             if (false !== mb_strpos($keyword, '<')) {
40                 $keyword = mb_substr($keyword, 0, -1);
41             }
42
43             $steps[] = new StepNode($keyword, $text, array(), $line++, $keywordType);
44         }
45
46         return $steps;
47     }
48 }