BehatExtension / DoctrineDataFixturesExtension

Doctrine Data Fixtures Extension for Behat
MIT License
20 stars 7 forks source link

Extension does not load Fixtures as a service in v6 #27

Closed Cethy closed 5 years ago

Cethy commented 5 years ago
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? / Specification no
Project version 6.0

As stated in https://github.com/BehatExtension/DoctrineDataFixturesExtension/issues/22, the extension should load fixtures w/ non-optional arguments. But it does not.

Because the BehatExtension\DoctrineDataFixturesExtension\Service\Loader extends the Doctrine\Common\DataFixtures\Loader which is not responsible for loading fixtures from DI (Doctrine\Bundle\FixturesBundle\Loader\SymfonyFixturesLoader is).

Spomky commented 5 years ago

Hi,

I explained the reasons why DI is not possible possible from this Behat extension in https://github.com/BehatExtension/DoctrineDataFixturesExtension/issues/22#issuecomment-427668030 and https://github.com/BehatExtension/DoctrineDataFixturesExtension/issues/22#issuecomment-432122894.

The only way to use fixtures with non-optional arguments is to declare these fixtures as services and tagged with doctrine.fixture.orm.

Spomky commented 5 years ago

In this particular case, the extension is not responsible of the fixture loading, your bundle is. Please have a look at this fixture or this one and their definitions. They are correctly loaded and used by the extension.

Cethy commented 5 years ago

The tests does not cover the DependentFixtureInterface usage. Please, have a look at this branch. I updated my PR to cover this bug.

Spomky commented 5 years ago

OK I misunderstood your concerns. You are right I missed the DependentFixtureInterface and OrderedFixtureInterface capabilities. I will check your PR.

Let move the discussion to #28.