2017 © Pedro PelĂĄez
 

library behat-di-builder-extension

A behat extension that allows injecting services from a container created with lcobucci/di-builder in contexts

image

lcobucci/behat-di-builder-extension

A behat extension that allows injecting services from a container created with lcobucci/di-builder in contexts

  • Tuesday, May 8, 2018
  • by lcobucci
  • Repository
  • 1 Watchers
  • 0 Stars
  • 668 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 116 % Grown

The README.md

lcobucci/di-builder extension for behat

![Total Downloads] ![Latest Stable Version] ![Unstable Version], (*1)

![Build Status] ![Code Coverage], (*2)

Allows injecting services from a container created using lcobucci/di-builder in a Behat context., (*3)

Installation

Package is available on Packagist, you can install it using Composer., (*4)

composer require --dev lcobucci/behat-di-builder-extension

Basic usage

You must first enable the extension on your behat configuration file:, (*5)

default:
  # ...

  extensions:
      Lcobucci\DependencyInjection\Behat\BuilderExtension: ~

Then enable the use of the test container (create by the extension) in the suite configuration:, (*6)

default:
  suites:
    my-suite:
      services: "@test_container"

  extensions:
      Lcobucci\DependencyInjection\Behat\BuilderExtension: ~

And finally inject the services into your contexts, (*7)

default:
  suites:
    my-suite:
      services: "@test_container"
      contexts:
        - My\Lovely\Context:
          - "@my_service"

  extensions:
    Lcobucci\DependencyInjection\Behat\BuilderExtension: ~

Advanced configuration

You can provide the following parameters to the extension to better configure it:, (*8)

  • name: if you already have an extension using test_container
  • container_builder: if your application already uses lcobucci/di-builder and you want to use it (instead of a blank container builder)
  • packages: so that you can add/override service definitions for testing

Your behat.yml would look like this with those settings:, (*9)

default:
  suites:
    my-suite:
      services: "@my_container"
      contexts:
        - My\Lovely\Context:
          - "@my_service"

  extensions:
    Lcobucci\DependencyInjection\Behat\BuilderExtension:
      name: "my_container"
      container_builder: "config/container_builder.php"
      packages:
        My\DIBuilder\Package: ~
        My\DIBuilder\PackageWithConstructorArguments:
          - "one"
          - "two"

The Versions

08/05 2018

dev-master

9999999-dev

A behat extension that allows injecting services from a container created with lcobucci/di-builder in contexts

  Sources   Download

MIT

The Requires

 

The Development Requires

by LuĂ­s Cobucci

08/05 2018

dev-fix-compatibility

dev-fix-compatibility

A behat extension that allows injecting services from a container created with lcobucci/di-builder in contexts

  Sources   Download

MIT

The Requires

 

The Development Requires

by LuĂ­s Cobucci

01/12 2017

0.1.x-dev

0.1.9999999.9999999-dev

A behat extension that allows injecting services from a container created with lcobucci/di-builder in contexts

  Sources   Download

MIT

The Requires

 

The Development Requires

by LuĂ­s Cobucci

01/12 2017

0.1.1

0.1.1.0

A behat extension that allows injecting services from a container created with lcobucci/di-builder in contexts

  Sources   Download

MIT

The Requires

 

The Development Requires

by LuĂ­s Cobucci

27/11 2017

0.1.0

0.1.0.0

A behat extension that allows injecting services from a container created with lcobucci/di-builder in contexts

  Sources   Download

MIT

The Requires

 

The Development Requires

by LuĂ­s Cobucci