-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Make doctrine.fixtures.loader
public
#222
Conversation
Tests are failing because something else. Master seems broken. |
Master is failing because a wrong merge in #216 (comment) |
Rebased on top of #223 to show that tests pass :) |
@ruudk can you rebase on top of master please? Thanks! |
This way, we can use fixtures as services in BehatExtension/DoctrineDataFixturesExtension#3
@alcaeus Done! |
Thanks! FWIW, I can't figure out why we need to expose the loader for use in the extension you mentioned. Looking at the service config, this might be a good opportunity to change the signature of the loader: instead of fetching services from the container, inject them properly using the service config. I don't see why we should expose services to the outside to cater to extensions that don't properly use the service container. |
@alcaeus Hmm, interesting. I'm gonna try to see if I can achieve it in a different way. |
My plan was to do the following:
Since this Behat extension has no way to hook into that point (using an compiler pass), it becomes extremely hard to do this. Do you have another idea? |
Or did you mean something like this: BehatExtension/DoctrineDataFixturesExtension#4 |
Even if you inject the loader, I wouldn't make the assumption that you want the behat extension to load the default fixtures. |
Any recommendations? My PR is not possible because Behat (+ extensions) run in a different container than the tests. |
@alcaeus I have a use case for this feature in my functional tests: Before I execute my tests I would like to load all my fixtures in a sqlite database. I do that in the class FunctionalTestCase extends KernelTestCase
{
private static $isDatabaseReady = false;
protected function setUp()
{
if (!self::$isDatabaseReady) {
self::bootKernel();
$databaseInitializer = new DatabaseInitializer(self::$kernel->getContainer());
$databaseInitializer->dropDatabase();
$databaseInitializer->loadSchema();
$databaseInitializer->loadFixtures();
self::$isDatabaseReady = true;
}
}
... Currently I have to look up all my fixtures with the Any chance to get that merged? |
If you need to make a service public, it's much better to add a public alias in a special Given that the original use-case (using the service within the Behat extension) is no longer given (the author also suggested to change the |
@alcaeus Thanks for the hint. I could solve it with your explanation. |
I'm trying to get https://github.com/BehatExtension/DoctrineDataFixturesExtension to work with version 3.0 of this bundle.
It would help if this service was public, so that we can use this service to load all fixtures with all the dependencies.
Related issue
BehatExtension/DoctrineDataFixturesExtension#3