Security update for permissions_by_term
[yaffs-website] / vendor / behat / gherkin / tests / Behat / Gherkin / Filter / FilterTest.php
1 <?php
2
3 namespace Tests\Behat\Gherkin\Filter;
4
5 use Behat\Gherkin\Keywords\ArrayKeywords;
6 use Behat\Gherkin\Lexer;
7 use Behat\Gherkin\Parser;
8
9 abstract class FilterTest extends \PHPUnit_Framework_TestCase
10 {
11     protected function getParser()
12     {
13         return new Parser(
14             new Lexer(
15                 new ArrayKeywords(array(
16                     'en' => array(
17                         'feature'          => 'Feature',
18                         'background'       => 'Background',
19                         'scenario'         => 'Scenario',
20                         'scenario_outline' => 'Scenario Outline|Scenario Template',
21                         'examples'         => 'Examples|Scenarios',
22                         'given'            => 'Given',
23                         'when'             => 'When',
24                         'then'             => 'Then',
25                         'and'              => 'And',
26                         'but'              => 'But'
27                     )
28                 ))
29             )
30         );
31     }
32
33     protected function getGherkinFeature()
34     {
35         return <<<GHERKIN
36 Feature: Long feature with outline
37   Scenario: Scenario#1
38     Given initial step
39     When action occurs
40     Then outcomes should be visible
41
42   Scenario: Scenario#2
43     Given initial step
44     And another initial step
45     When action occurs
46     Then outcomes should be visible
47
48   Scenario Outline: Scenario#3
49     When <action> occurs
50     Then <outcome> should be visible
51
52     Examples:
53       | action | outcome |
54       | act#1  | out#1   |
55       | act#2  | out#2   |
56       | act#3  | out#3   |
57 GHERKIN;
58     }
59
60     protected function getParsedFeature()
61     {
62         return $this->getParser()->parse($this->getGherkinFeature());
63     }
64 }