Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose fixture executor to make references available #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Expose fixture executor to make references available #9

wants to merge 1 commit into from

Conversation

bjo3rnf
Copy link

@bjo3rnf bjo3rnf commented Apr 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant