X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fgherkin%2Ftests%2FBehat%2FGherkin%2FKeywords%2FArrayKeywordsTest.php;fp=vendor%2Fbehat%2Fgherkin%2Ftests%2FBehat%2FGherkin%2FKeywords%2FArrayKeywordsTest.php;h=e6c18dc946d6e7e4896a0b39b8826cf83bf904e6;hp=0000000000000000000000000000000000000000;hb=1270d9129ce8f27c9b28b10518e32132c58e0aca;hpb=c27c0f0cdaa3f354b1fe54a56ae7e854be6e3f68 diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/ArrayKeywordsTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/ArrayKeywordsTest.php new file mode 100644 index 000000000..e6c18dc94 --- /dev/null +++ b/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/ArrayKeywordsTest.php @@ -0,0 +1,48 @@ +getKeywordsArray()); + } + + protected function getKeywordsArray() + { + return array( + 'with_special_chars' => array( + 'and' => 'And/foo', + 'background' => 'Background.', + 'but' => 'But[', + 'examples' => 'Examples|Scenarios', + 'feature' => 'Feature|Business Need|Ability', + 'given' => 'Given', + 'name' => 'English', + 'native' => 'English', + 'scenario' => 'Scenario', + 'scenario_outline' => 'Scenario Outline|Scenario Template', + 'then' => 'Then', + 'when' => 'When', + ), + ); + } + + protected function getSteps($keywords, $text, &$line, $keywordType) + { + $steps = array(); + foreach (explode('|', $keywords) as $keyword) { + if (false !== mb_strpos($keyword, '<')) { + $keyword = mb_substr($keyword, 0, -1); + } + + $steps[] = new StepNode($keyword, $text, array(), $line++, $keywordType); + } + + return $steps; + } +}