2017 © Pedro Peláez
 

behat-extension mock-extension

Mock extension for Behat

image

rezzza/mock-extension

Mock extension for Behat

  • Friday, March 25, 2016
  • by tyx
  • Repository
  • 6 Watchers
  • 6 Stars
  • 6,658 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 3 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Behat Mock Extension

DEPRECATED We no longer provide support for this extension. Feel free to fork., (*1)

Let the mock engine that you want coming to help you in your behat tests by mocking the Symfony services., (*2)

Only Behat 2 supported for now., (*3)

Adapters

  • Atoum : https://github.com/atoum/atoum

Setup

1 - Declare to use the extension in your behat.yml, (*4)

default:
    extensions:
        Rezzza\MockExtension\Extension: ~

2 - Implements Rezzza\MockExtension\MockAware interface on your context., (*5)

3 - Override AppKernel::getContainerBaseClass, (*6)

    protected function getContainerBaseClass()
    {
        if ('test' == $this->environment) {
            return 'Rezzza\MockExtension\MockContainer';
        }

        return parent::getContainerBaseClass();
    }

Usage

In your context create mock for your services :, (*7)

use Rezzza\MockExtension\Adapter\AtoumAdapter;

$mockGoutte = $this->mocker->mockService(
    'my.goutte_client',
    new AtoumAdapter('\Behat\Mink\Driver\Goutte\Client')
);

Then follow the instructions of your mock engine to use the result, (*8)

Contribute

If you want to see your prefered mock engine, you can make a PR by creation the adapter., (*9)

It just needs to follow Rezzza\MockExtension\MockEngine interface., (*10)

Credit

Initial concept come from : https://github.com/PolishSymfonyCommunity/Symfony2MockerExtension, (*11)

but Mockery drives me crazy..., (*12)

The Versions

25/03 2016

dev-master

9999999-dev https://github.com/rezzza/mock-extension

Mock extension for Behat

  Sources   Download

MIT

The Requires

 

service mock symfony

25/03 2016

dev-behat3

dev-behat3 https://github.com/rezzza/mock-extension

Mock extension for Behat

  Sources   Download

MIT

The Requires

 

service mock symfony

14/12 2015
14/12 2015
02/12 2014

1.1.0

1.1.0.0 https://github.com/rezzza/mock-extension

Mock extension for Behat

  Sources   Download

MIT

The Requires

 

service mock symfony

02/12 2014
02/12 2014
19/11 2014
12/08 2014