Closed Cethy closed 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
.
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.
The tests does not cover the DependentFixtureInterface
usage. Please, have a look at this branch.
I updated my PR to cover this bug.
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.
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 theDoctrine\Common\DataFixtures\Loader
which is not responsible for loading fixtures from DI (Doctrine\Bundle\FixturesBundle\Loader\SymfonyFixturesLoader
is).