@@ -30,18 +30,18 @@ discard block |
||
| 30 | 30 | header('Content-type: text/plain'); |
| 31 | 31 | |
| 32 | 32 | $keywords = new Behat\Gherkin\Keywords\ArrayKeywords(array( |
| 33 | - 'en' => array( |
|
| 34 | - 'feature' => 'Feature', |
|
| 35 | - 'background' => 'Background', |
|
| 36 | - 'scenario' => 'Scenario', |
|
| 37 | - 'scenario_outline' => 'Scenario Outline', |
|
| 38 | - 'examples' => 'Examples', |
|
| 39 | - 'given' => 'Given', |
|
| 40 | - 'when' => 'When', |
|
| 41 | - 'then' => 'Then', |
|
| 42 | - 'and' => 'And', |
|
| 43 | - 'but' => 'But' |
|
| 44 | - ), |
|
| 33 | + 'en' => array( |
|
| 34 | + 'feature' => 'Feature', |
|
| 35 | + 'background' => 'Background', |
|
| 36 | + 'scenario' => 'Scenario', |
|
| 37 | + 'scenario_outline' => 'Scenario Outline', |
|
| 38 | + 'examples' => 'Examples', |
|
| 39 | + 'given' => 'Given', |
|
| 40 | + 'when' => 'When', |
|
| 41 | + 'then' => 'Then', |
|
| 42 | + 'and' => 'And', |
|
| 43 | + 'but' => 'But' |
|
| 44 | + ), |
|
| 45 | 45 | )); |
| 46 | 46 | $lexer = new Behat\Gherkin\Lexer($keywords); |
| 47 | 47 | $parser = new Behat\Gherkin\Parser($lexer); |
@@ -51,23 +51,23 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | catch (Exception $ex) { |
| 53 | 53 | echo $ex->getMessage() . "\n"; |
| 54 | - exit; |
|
| 54 | + exit; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | foreach ($feature->getScenarios() as $scenario) { |
| 58 | - if ($scenario instanceof OutlineNode) { |
|
| 59 | - echo $scenario->getExampleTable() . "\n\n"; |
|
| 60 | - } |
|
| 61 | - elseif ($scenario instanceof ScenarioNode) { |
|
| 62 | - foreach ($scenario->getSteps() as $step) { |
|
| 63 | - foreach ($step->getArguments() as $argument) { |
|
| 64 | - if ($argument instanceof TableNode) { |
|
| 65 | - echo $argument . "\n\n"; |
|
| 66 | - } |
|
| 67 | - } |
|
| 68 | - // print_r($step); |
|
| 69 | - } |
|
| 70 | - } |
|
| 58 | + if ($scenario instanceof OutlineNode) { |
|
| 59 | + echo $scenario->getExampleTable() . "\n\n"; |
|
| 60 | + } |
|
| 61 | + elseif ($scenario instanceof ScenarioNode) { |
|
| 62 | + foreach ($scenario->getSteps() as $step) { |
|
| 63 | + foreach ($step->getArguments() as $argument) { |
|
| 64 | + if ($argument instanceof TableNode) { |
|
| 65 | + echo $argument . "\n\n"; |
|
| 66 | + } |
|
| 67 | + } |
|
| 68 | + // print_r($step); |
|
| 69 | + } |
|
| 70 | + } |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | print_r($feature); |