2017 © Pedro Peláez
 

library transmogrifierextension

Behat Extension for the Transmogrifier database fixture library

image

linkorb/transmogrifierextension

Behat Extension for the Transmogrifier database fixture library

  • Wednesday, March 4, 2015
  • by joostfaassen
  • Repository
  • 10 Watchers
  • 2 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Transmogrifier Behat Extension

, (*1)

Transmogrifier is a tool to help setup your database fixtures before running your tests., (*2)

This is repository contains the Transmogrifier Extension for Behat., (*3)

This allows you to use Transmogrifier directly from your Behat .feature files!, (*4)

Adding the extension will activate a few new Gherkin commands to help you initialize your database testing fixtures., (*5)

Installing the extension through composer

Open your composer.json file, and add this to the require section:, (*6)

"linkorb/transmogrifierextension": "dev-master"

Enabling the Behat extension

Edit your features/bootstrap/FeatureContext.php file, and add the following line to the __construct method:, (*7)

$this->useContext(
    'transmogrifier',
    new \LinkORB\TransmogrifierExtension\TransmogrifierContext($parameters)
);

How to use the extension in your .feature files

You can use the following new syntax in your .feature files:, (*8)

    Scenario: Applying a yml dataset to the `test` database
        Given I connect to database "test"
        When I apply dataset "user.yml"
        Then I should have "2" records in the "user" table

This example scenario will tell Behat to connect to the database test, load dataset user.yml, and apply it. After that it will verify the user table contains 2 records (just like the yml file)., (*9)

Configuring the extension in behat.yml

For this to work, you will need to tell Behat and Transmogrifier where to find your datasets, and where to find your database config files., (*10)

Edit your behat.yml file, and add the following:, (*11)

default:
    extensions:
        LinkORB\TransmogrifierExtension\Extension:
            dbconf_dir: /share/config/database/
            dataset_dir: example/

These paths can be either absolute or relative from the directory where you start Behat., (*12)

Behat example

The features/ directory in this repository contains a fully functional transmogrifier.feature file., (*13)

More info?

Check the Transmogrifier repo for more information: http://www.github.com/linkorb/transmogrifier/, (*14)

Brought to you by the LinkORB Engineering team


Check out our other projects at linkorb.com/engineering., (*15)

Btw, we're hiring!, (*16)

The Versions

04/03 2015

dev-master

9999999-dev http://www.github.com/linkorb/transmogrifierextension

Behat Extension for the Transmogrifier database fixture library

  Sources   Download

MIT

The Requires

 

database testing extension php behat fixture transmogrifier

04/03 2015

v2.0.0

2.0.0.0 http://www.github.com/linkorb/transmogrifierextension

Behat Extension for the Transmogrifier database fixture library

  Sources   Download

MIT

The Requires

 

database testing extension php behat fixture transmogrifier

26/02 2015

v1.0.0

1.0.0.0 http://www.github.com/linkorb/transmogrifierextension

Behat Extension for the Transmogrifier database fixture library

  Sources   Download

The Requires

 

database testing extension php behat fixture transmogrifier

26/02 2015

v1.1.0

1.1.0.0 http://www.github.com/linkorb/transmogrifierextension

Behat Extension for the Transmogrifier database fixture library

  Sources   Download

The Requires

 

database testing extension php behat fixture transmogrifier