vipsoft / DoctrineDataFixturesExtension

Doctrine Data Fixtures Extension for Behat
MIT License
21 stars 35 forks source link

Allow .feature files to specify which profile to run under #11

Open ebonhand09 opened 12 years ago

ebonhand09 commented 12 years ago

Example use case: I have some .feature scenarios that require one set of fixtures to be loaded, and some scenarios within the same bundle that require a different set (for example, testing that the 'no data' message is displayed correctly when there is no data, and also testing that when there is data, it's displayed properly)

I'm looking for a way that allows the .feature scenario to specify which configuration profile (or similar) is runs under, similar to @javascript at the start of a .feature

For my example use case, I could then include a profile in my behat.yml

load_fixture_foo:
    extensions:
        VIPSoft\DoctrineDataFixturesExtension\Extension:
            fixtures:
                - My\SomethingBundle\DataFixtures\ORM\LoadFooData

.. and have Behat give me what I'm asking for when I include the tag @load_fixture_foo in my .feature

Can this be done? Is it possible? No idea - Is it useful? yes. I'm having to use multiple sets of profiles to simulate this, one for every possible combination of fixtures I need in my scenarios

Let me know your thoughts

robocoder commented 12 years ago

It's probably doable but I'd wait for behat/behat#148.

The main obstacle for me is that the current extension is designed to cache a single sqlite file.

ebonhand09 commented 12 years ago

I'm a patient man - thanks for considering my request