廖泽华 a37f2bbff5 init code | il y a 4 ans | |
---|---|---|
.. | ||
bin | il y a 4 ans | |
src | il y a 4 ans | |
tests | il y a 4 ans | |
.gitignore | il y a 4 ans | |
.travis.yml | il y a 4 ans | |
CHANGES.md | il y a 4 ans | |
CONTRIBUTING.md | il y a 4 ans | |
LICENSE | il y a 4 ans | |
README.md | il y a 4 ans | |
composer.json | il y a 4 ans | |
i18n.php | il y a 4 ans | |
libpath.php | il y a 4 ans | |
package.xml.tpl | il y a 4 ans | |
phpdoc.ini.dist | il y a 4 ans | |
phpunit.xml.dist | il y a 4 ans |
This is the php Gherkin parser for Behat. It comes bundled with more than 40 native languages
(see i18n.php
) support & clean architecture.
#behat
<?php
$keywords = new Behat\Gherkin\Keywords\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'
),
'en-pirate' => array(
'feature' => 'Ahoy matey!',
'background' => 'Yo-ho-ho',
'scenario' => 'Heave to',
'scenario_outline' => 'Shiver me timbers',
'examples' => 'Dead men tell no tales',
'given' => 'Gangway!',
'when' => 'Blimey!',
'then' => 'Let go and haul',
'and' => 'Aye',
'but' => 'Avast!'
)
));
$lexer = new Behat\Gherkin\Lexer($keywords);
$parser = new Behat\Gherkin\Parser($lexer);
$feature = $parser->parse(file_get_contents('some.feature'));
$> curl http://getcomposer.org/installer | php
$> php composer.phar update