-
-
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
[LoadDataFixturesDoctrineCommand] doctrine:fixtures:load --env=test #34
Comments
you can already achieve such thing with the |
Hi thanks for the reply So we will have foreach envorinment the correct fixtures |
indeed, --env option could be very usefull to test on each environment... thx |
@ptitcub that option already exist, but there's no way to use different fixtures for differents env |
Hi, i think it's a very common usecase to have different fixtures in the environments like test,prod,dev. I understand that one could achive such behavior with the fixture parameter, but I think there should be a more convenient way to do that. Additionally I would like to recommend to have something like 'inheritance'. That would allow a set of fixtures as a base and then specializations for the environments. |
This feature will be really useful if integrated with Doctrine DBAL, allowing us to load test fixtures into a test database, isolating test data, instead of dirtying the development database with test data, or purging develpment database everytime you ran your application tests.. That would be so useful.. |
It would be nice to have some way of running certain fixtures base on some sort of criteria. However I think using an annotation such as @group on the fixture methods, with --include/exclude filter would be a better approach than separating them via directories or environments. This way you have a lot more flexibility when applying fixtures. For example you may have some fixture data related to users that you want applied to all environments but you only want to create users in test/dev. |
+1 |
@ashton : There is a solution for that! In your doctrine:
dbal:
dbname: %database_name%_test |
@liuggio Why ? |
For 2 main reasons |
you mean "explicit is always better than implicit" I suppose… how i using a file named And I can't see how I'm creating a convention, this file was here in the first place. Can't see how this is bad either. You need to make more compelling arguments (or to withdraw your previous claim, which would be the way to go IMO). |
ops yes was implicit. Explicit =
I think you have all the arguments.
no comment. |
Yeah sorry, I did, but you have to admit they were not very clearly expressed. I understand how I created a convention, but I don't think it is bad at all. By putting the Thinking harder, I think there is one case where I might consider your proposition : If I have a CI server that has databases and I don't want to have all databases suffixed with
|
People can do what they want to configure their test environment in their project, either using a suffix to their database name, or putting a separate parameter in their parameters.yml file for the test database. |
Closing since test databases are already possible and issues already exist for selective loading: doctrine/data-fixtures#169, doctrine/data-fixtures#140 |
Hi,
Usually when we develop we have more than one set of fixtures,
for example, the fixtures are many more on stage than on test
So we created two folder foreach bundle
DataFixtures / test / ORM / ...
DataFixtures / ORM / ... // stage
It would be nice if you could load a set of fixtures
depending from wich environment you select, for example for the 'dev' env.
would be loaded the fixtures in bundleName / DataFixtures / dev / ORM / ...
The solution is easy just add a parameter and add a row on the row number 90.
I could do it, what do you think?
The text was updated successfully, but these errors were encountered: