2017 © Pedro Peláez
 

library context-service-extension

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

image

friends-of-behat/context-service-extension

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

  • Tuesday, February 13, 2018
  • by pamil
  • Repository
  • 2 Watchers
  • 50 Stars
  • 173,321 Installations
  • PHP
  • 83 Dependents
  • 1 Suggesters
  • 6 Forks
  • 2 Open issues
  • 8 Versions
  • 26 % Grown

The README.md

Context Service Extension License Version Build status on Linux Scrutinizer Quality Score

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., (*1)

Usage

  1. Install it:, (*2)

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

    # 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., (*4)

    <!-- 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):, (*5)

    # behat.yml
    default:
        # ...
           suites:
               default:
                   contexts_services:
                       - acme.my_context
    
  5. Have fun with your contexts defined in DI container as services! :tada:, (*6)

The Versions

13/02 2018

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

13/02 2018

v1.2.0

1.2.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

22/12 2017

v1.1.1

1.1.1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

21/12 2017

v1.1.0

1.1.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

10/07 2017

v1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

03/11 2016

v0.3.0

0.3.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

02/11 2016

v0.2.0

0.2.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

25/10 2016

v0.1.0

0.1.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires