Security update for permissions_by_term
[yaffs-website] / vendor / behat / gherkin / tests / Behat / Gherkin / Keywords / ArrayKeywordsTest.php
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 (file)
index 0000000..e6c18dc
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+
+namespace Tests\Behat\Gherkin\Keywords;
+
+use Behat\Gherkin\Keywords\ArrayKeywords;
+use Behat\Gherkin\Node\StepNode;
+
+class ArrayKeywordsTest extends KeywordsTest
+{
+    protected function getKeywords()
+    {
+        return new ArrayKeywords($this->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;
+    }
+}