module-doctrine2
module-doctrine2 copied to clipboard
Expose fixture executor to make references available
With returning the ORMExecutor after loading fixtures it is possible to access the ReferenceRepository which in turn allows fetching concrete fixture instances by reference:
/** @var \Doctrine\Common\DataFixtures\ReferenceRepository $repo */
$repo = $I->loadFixtures(Foo::class)->getReferenceRepository();
/** @var Foo $foo */
$foo = $repo->getReference('foo');
which comes in very handy. See the included UnitTest for an example.
Edit: I don't know why Travis fails, local tests don't