friends-of-behat/context-service-extension 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

friends-of-behat/context-service-extension

最新稳定版本:v1.3.0

Composer 安装命令:

composer require friends-of-behat/context-service-extension

包简介

Allows to declare and use contexts services in scenario scoped container.

README 文档

README

This library is deprecated! It will not be supported anymore - if you're using it with CrossContainerExtension v1 and SymfonyExtension v1, please consider an upgrade to SymfonyExtension v2.

Allows to declare and use contexts services in scenario scoped container.

Usage

  1. Install it:

    $ composer require friends-of-behat/context-service-extension --dev
  2. Enable and configure context service extension in your Behat configuration:

    # behat.yml
    default:
        # ...
        extensions:
            FriendsOfBehat\ContextServiceExtension:
               imports:
                   - "features/bootstrap/config/services.xml"
                   - "features/bootstrap/config/services.yml"
                   - "features/bootstrap/config/services.php"   
  3. Inside one of those files passed to configuration above, create a service tagged with fob.context_service.

    <!-- features/bootstrap/config/services.xml -->
    <?xml version="1.0" encoding="UTF-8" ?>
    <container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services">
        <services>
            <service id="acme.my_context" class="Acme\MyContext">
                <tag name="fob.context_service" />
            </service>
        </services>
    </container>
    # features/bootstrap/config/services.yml
    services:
        acme.my_context:
            class: Acme\MyContext
            tags:
                - { name: fob.context_service }
    // features/bootstrap/config/services.php
    use Symfony\Component\DependencyInjection\Definition;
    
    $definition = new Definition(\Acme\MyContext::class);
    $definition->addTag('fob.context_service');
    $container->setDefinition('acme.my_context', $definition);
  4. Configure your suite to use acme.my_context context service (note contexts_services key instead of contexts):

    # behat.yml
    default:
        # ...
           suites:
               default:
                   contexts_services:
                       - acme.my_context
  5. Have fun with your contexts defined in DI container as services! 🎉

统计信息

  • 总下载量: 565.39k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 115
  • 点击次数: 1
  • 依赖项目数: 58
  • 推荐数: 1

GitHub 信息

  • Stars: 115
  • Watchers: 3
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-25