X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fgherkin%2Ftests%2FBehat%2FGherkin%2FKeywords%2FKeywordsTest.php;fp=vendor%2Fbehat%2Fgherkin%2Ftests%2FBehat%2FGherkin%2FKeywords%2FKeywordsTest.php;h=0000000000000000000000000000000000000000;hp=fdfc65e29567ec5d21af803a4f2d1aef2a13a6df;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsTest.php deleted file mode 100644 index fdfc65e29..000000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Keywords/KeywordsTest.php +++ /dev/null @@ -1,139 +0,0 @@ -getKeywords(); - $lexer = new Lexer($keywords); - $parser = new Parser($lexer); - $dumper = new KeywordsDumper($keywords); - $keywordsArray = $this->getKeywordsArray(); - - // Remove languages with repeated keywords - unset($keywordsArray['en-old'], $keywordsArray['uz']); - - $data = array(); - foreach ($keywordsArray as $lang => $i18nKeywords) { - $features = array(); - foreach (explode('|', $i18nKeywords['feature']) as $transNum => $featureKeyword) { - $line = 1; - if ('en' !== $lang) { - $line = 2; - } - - $featureLine = $line; - $line += 5; - - $keywords = explode('|', $i18nKeywords['background']); - $backgroundLine = $line; - $line += 1; - $background = new BackgroundNode(null, array_merge( - $this->getSteps($i18nKeywords['given'], 'there is agent A', $line, 'Given'), - $this->getSteps($i18nKeywords['and'], 'there is agent B', $line, 'Given') - ), $keywords[0], $backgroundLine); - - $line += 1; - - $scenarios = array(); - - foreach (explode('|', $i18nKeywords['scenario']) as $scenarioKeyword) { - $scenarioLine = $line; - $line += 1; - - $steps = array_merge( - $this->getSteps($i18nKeywords['given'], 'there is agent J', $line, 'Given'), - $this->getSteps($i18nKeywords['and'], 'there is agent K', $line, 'Given'), - $this->getSteps($i18nKeywords['when'], 'I erase agent K\'s memory', $line, 'When'), - $this->getSteps($i18nKeywords['then'], 'there should be agent J', $line, 'Then'), - $this->getSteps($i18nKeywords['but'], 'there should not be agent K', $line, 'Then') - ); - - $scenarios[] = new ScenarioNode('Erasing agent memory', array(), $steps, $scenarioKeyword, $scenarioLine); - $line += 1; - } - foreach (explode('|', $i18nKeywords['scenario_outline']) as $outlineKeyword) { - $outlineLine = $line; - $line += 1; - - $steps = array_merge( - $this->getSteps($i18nKeywords['given'], 'there is agent ', $line, 'Given'), - $this->getSteps($i18nKeywords['and'], 'there is agent ', $line, 'Given'), - $this->getSteps($i18nKeywords['when'], 'I erase agent \'s memory', $line, 'When'), - $this->getSteps($i18nKeywords['then'], 'there should be agent ', $line, 'Then'), - $this->getSteps($i18nKeywords['but'], 'there should not be agent ', $line, 'Then') - ); - $line += 1; - - $keywords = explode('|', $i18nKeywords['examples']); - $table = new ExampleTableNode(array( - ++$line => array('agent1', 'agent2'), - ++$line => array('D', 'M') - ), $keywords[0]); - $line += 1; - - $scenarios[] = new OutlineNode('Erasing other agents\' memory', array(), $steps, $table, $outlineKeyword, $outlineLine); - $line += 1; - } - - $features[] = new FeatureNode( - 'Internal operations', - <<dump($lang, false, true); - $parsed = array(); - try { - foreach ($dumped as $num => $dumpedFeature) { - $parsed[] = $parser->parse($dumpedFeature, $lang . '_' . ($num + 1) . '.feature'); - } - } catch (\Exception $e) { - throw new \Exception($e->getMessage() . ":\n" . json_encode($dumped), 0, $e); - } - - $data[] = array($lang, $features, $parsed); - } - - return $data; - } - - /** - * @dataProvider translationTestDataProvider - * - * @param string $language language name - * @param array $etalon etalon features (to test against) - * @param array $features array of parsed feature(s) - */ - public function testTranslation($language, array $etalon, array $features) - { - $this->assertEquals($etalon, $features); - } -}