Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 17, 2024 via composer

behat/gherkin v4.9.0

Gherkin DSL parser for PHP
Package summary
Share
0
issues
1
license
1
MIT
Package created
1 Dec 2011
Version published
12 Oct 2021
Maintainers
4
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
behat/gherkin@v4.9.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of behat/gherkin 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does behat/gherkin do?

Behat/Gherkin is an innovative Domain Specific Language (DSL) parser for PHP. The main function of Behat/Gherkin is to read and interpret Gherkin code - an uncomplicated, natural language used mainly for behavior-driven development. It's an indispensable tool for applications that require BDD. Behat/Gherkin offers support for over 40 native languages, ensuring a clean, seamless architecture.

How do you use behat/gherkin?

Using Behat/Gherkin involves coding with PHP. To use it, you will need to create a new instance of the Behat\Gherkin\Keywords\ArrayKeywords object with an associated array of keywords. Then, create an instance of the Behat\Gherkin\Lexer by passing the $keywords object in its constructor. A Behat\Gherkin\Parser instance is created subsequently, passing the $lexer object as the argument. The parse method of the Parser can be used to parse any Gherkin files. Here is a PHP code example of how to use Behat/Gherkin:

$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'
    ),
));
$lexer  = new Behat\Gherkin\Lexer($keywords);
$parser = new Behat\Gherkin\Parser($lexer);
$feature = $parser->parse(file_get_contents('some.feature'));

Ensure that the 'some.feature' file is in the Gherkin format.

Where are the behat/gherkin docs?

For comprehensive documentation about using Behat/Gherkin, a visit to the official Google Group at http://groups.google.com/group/behat is recommended. The group contains an assortment of resources, guidelines, and best practices that explain in depth how to make the most out of Behat/Gherkin. Additionally, for real-time interactions, you can connect with peers and experts on the #behat channel on Freenode.