keywords = new ArrayKeywords(array( 'en' => array( 'feature' => 'Feature', 'background' => 'Background', 'scenario' => 'Scenario', 'scenario_outline' => 'Scenario Outline|Scenario Template', 'examples' => 'Examples|Scenarios', 'given' => 'Given', 'when' => 'When', 'then' => 'Then', 'and' => 'And', 'but' => 'But' ), 'ru' => array( 'feature' => 'Функционал|Фича', 'background' => 'Предыстория|Бэкграунд', 'scenario' => 'Сценарий|История', 'scenario_outline' => 'Структура сценария|Аутлайн', 'examples' => 'Значения', 'given' => 'Допустим', 'when' => 'Если|@', 'then' => 'То', 'and' => 'И', 'but' => 'Но' ) )); } public function testEnKeywordsDumper() { $dumper = new KeywordsDumper($this->keywords); $dumped = $dumper->dump('en'); $etalon = << And there is agent When I erase agent 's memory Then there should be agent But there should not be agent (Examples|Scenarios): | agent1 | agent2 | | D | M | GHERKIN; $this->assertEquals($etalon, $dumped); } public function testRuKeywordsDumper() { $dumper = new KeywordsDumper($this->keywords); $dumped = $dumper->dump('ru'); $etalon = << И there is agent (Если|@) I erase agent 's memory То there should be agent Но there should not be agent Значения: | agent1 | agent2 | | D | M | GHERKIN; $this->assertEquals($etalon, $dumped); } public function testRuKeywordsCustomKeywordsDumper() { $dumper = new KeywordsDumper($this->keywords); $dumper->setKeywordsDumperFunction(function ($keywords) { return ''.implode(', ', $keywords).''; }); $dumped = $dumper->dump('ru'); $etalon = <<Функционал, Фича: Internal operations In order to stay secret As a secret organization We need to be able to erase past agents' memory Предыстория, Бэкграунд: Допустим there is agent A И there is agent B Сценарий, История: Erasing agent memory Допустим there is agent J И there is agent K Если, @ I erase agent K's memory То there should be agent J Но there should not be agent K Структура сценария, Аутлайн: Erasing other agents' memory Допустим there is agent И there is agent Если, @ I erase agent 's memory То there should be agent Но there should not be agent Значения: | agent1 | agent2 | | D | M | GHERKIN; $this->assertEquals($etalon, $dumped); } public function testExtendedVersionDumper() { $dumper = new KeywordsDumper($this->keywords); $dumped = $dumper->dump('ru', false); $etalon = array( << И there is agent Если I erase agent 's memory @ I erase agent 's memory То there should be agent Но there should not be agent Значения: | agent1 | agent2 | | D | M | Аутлайн: Erasing other agents' memory Допустим there is agent И there is agent Если I erase agent 's memory @ I erase agent 's memory То there should be agent Но there should not be agent Значения: | agent1 | agent2 | | D | M | GHERKIN , << И there is agent Если I erase agent 's memory @ I erase agent 's memory То there should be agent Но there should not be agent Значения: | agent1 | agent2 | | D | M | Аутлайн: Erasing other agents' memory Допустим there is agent И there is agent Если I erase agent 's memory @ I erase agent 's memory То there should be agent Но there should not be agent Значения: | agent1 | agent2 | | D | M | GHERKIN ); $this->assertEquals($etalon, $dumped); } }