定制 behat/gherkin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

behat/gherkin

最新稳定版本:v4.16.1

Composer 安装命令:

composer require behat/gherkin

包简介

Gherkin DSL parser for PHP

README 文档

README

This is the php Gherkin parser for Behat. It comes bundled with more than 40 native languages (see i18n.php) support and clean architecture.

Useful Links

Usage Example

<?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'));

Installing Dependencies

curl https://getcomposer.org/installer | php
php composer.phar update

Contributors

Support the project

Behat is free software, maintained by volunteers as a gift for users. If you'd like to see the project continue to thrive, and particularly if you use it for work, we'd encourage you to contribute.

Contributions of time - whether code, documentation, or support reviewing PRs and triaging issues - are very welcome and valued by the maintainers and the wider Behat community.

But we also believe that financial sponsorship is an important part of a healthy Open Source ecosystem. Maintaining a project like Behat requires a significant commitment from the core team: your support will help us to keep making that time available over the long term. Even small contributions make a big difference.

You can support @acoulton, @carlos-granados and @stof on GitHub sponsors. If you'd like to discuss supporting us in a different way, please get in touch!

统计信息

  • 总下载量: 168.88M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1065
  • 点击次数: 1
  • 依赖项目数: 95
  • 推荐数: 0

GitHub 信息

  • Stars: 1058
  • Watchers: 16
  • Forks: 95
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04