Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 69 lines (56 sloc) 2.432 kB
122740d @everzet updated readme
everzet authored
1 Behat Gherkin Parser
2 ====================
3
eb0ce5c @everzet Update documentation
everzet authored
4 This is the php Gherkin parser for Behat. It comes bundled with more than 40 native languages
5 (see `i18n.php`) support & clean architecture.
2444417 @everzet added travis ci status to the README
everzet authored
6
bdd4222 @stof Updated the badges displayed in the readme
stof authored
7 [![Build Status](https://travis-ci.org/Behat/Gherkin.svg?branch=master)](https://travis-ci.org/Behat/Gherkin)
8 [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Behat/Gherkin/badges/quality-score.png?s=04d9d0237c89f4c45a94ba5304234db861dfd036)](https://scrutinizer-ci.com/g/Behat/Gherkin/)
9 [![Code Coverage](https://scrutinizer-ci.com/g/Behat/Gherkin/badges/coverage.png?s=204ca44800469d295b73d18c91011cb9d2dc99fc)](https://scrutinizer-ci.com/g/Behat/Gherkin/)
122740d @everzet updated readme
everzet authored
10
eb0ce5c @everzet Update documentation
everzet authored
11 Useful Links
12 ------------
13
14 - Official Google Group is at [http://groups.google.com/group/behat](http://groups.google.com/group/behat)
15 - IRC channel on [#freenode](http://freenode.net/) is `#behat`
16 - [Note on Patches/Pull Requests](CONTRIBUTING.md)
122740d @everzet updated readme
everzet authored
17
eb0ce5c @everzet Update documentation
everzet authored
18 Usage Example
19 -------------
122740d @everzet updated readme
everzet authored
20
e55a947 @everzet syntax highlighting
everzet authored
21 ``` php
22 <?php
23
24 $keywords = new Behat\Gherkin\Keywords\ArrayKeywords(array(
25 'en' => array(
fe29e58 @everzet updated README
everzet authored
26 'feature' => 'Feature',
27 'background' => 'Background',
28 'scenario' => 'Scenario',
29 'scenario_outline' => 'Scenario Outline|Scenario Template',
30 'examples' => 'Examples|Scenarios',
31 'given' => 'Given',
32 'when' => 'When',
33 'then' => 'Then',
34 'and' => 'And',
35 'but' => 'But'
e55a947 @everzet syntax highlighting
everzet authored
36 ),
62a533b @everzet updating translation examples
everzet authored
37 'en-pirate' => array(
fe29e58 @everzet updated README
everzet authored
38 'feature' => 'Ahoy matey!',
39 'background' => 'Yo-ho-ho',
40 'scenario' => 'Heave to',
41 'scenario_outline' => 'Shiver me timbers',
42 'examples' => 'Dead men tell no tales',
43 'given' => 'Gangway!',
44 'when' => 'Blimey!',
45 'then' => 'Let go and haul',
46 'and' => 'Aye',
47 'but' => 'Avast!'
e55a947 @everzet syntax highlighting
everzet authored
48 )
49 ));
50 $lexer = new Behat\Gherkin\Lexer($keywords);
51 $parser = new Behat\Gherkin\Parser($lexer);
52
4bf0ced @everzet updated readme
everzet authored
53 $feature = $parser->parse(file_get_contents('some.feature'));
e55a947 @everzet syntax highlighting
everzet authored
54 ```
122740d @everzet updated readme
everzet authored
55
bf38a89 @everzet updated README
everzet authored
56 Installing Dependencies
57 -----------------------
58
59 ``` bash
eb0ce5c @everzet Update documentation
everzet authored
60 $> curl http://getcomposer.org/installer | php
61 $> php composer.phar update
bf38a89 @everzet updated README
everzet authored
62 ```
63
122740d @everzet updated readme
everzet authored
64 Contributors
65 ------------
66
67 * Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer]
eb0ce5c @everzet Update documentation
everzet authored
68 * Other [awesome developers](https://github.com/Behat/Gherkin/graphs/contributors)
Something went wrong with that request. Please try again.