廖泽华 a37f2bbff5 init code | 4 gadi atpakaļ | |
---|---|---|
.. | ||
bin | 4 gadi atpakaļ | |
src | 4 gadi atpakaļ | |
tests | 4 gadi atpakaļ | |
.gitignore | 4 gadi atpakaļ | |
.travis.yml | 4 gadi atpakaļ | |
CHANGES.md | 4 gadi atpakaļ | |
CONTRIBUTING.md | 4 gadi atpakaļ | |
LICENSE | 4 gadi atpakaļ | |
README.md | 4 gadi atpakaļ | |
composer.json | 4 gadi atpakaļ | |
i18n.php | 4 gadi atpakaļ | |
libpath.php | 4 gadi atpakaļ | |
package.xml.tpl | 4 gadi atpakaļ | |
phpdoc.ini.dist | 4 gadi atpakaļ | |
phpunit.xml.dist | 4 gadi atpakaļ |
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