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

Fixtures path #10

Open
theofidry opened this issue Jul 10, 2015 · 2 comments

Comments

@theofidry
Copy link

commented Jul 10, 2015

As of now Alice fixtures must be placed under Resources/fixtures/orm.

Wouldn't it better to keep the DoctrineFixtures behavior which allows to specify the path where the loader is declared and with a default file path? And wouldn't it be better to keep the default path and make it configurable?

That would have the benefits to:

  • ease the transition if previously using another bundle to do this kind of task
  • keep the same convention while allowing one to define it's own convention and keeping the interesting feature you introduced which is loading fixtures for a given bundle
  • being more generic and not too much Symfony specific

Besides for the filtering you're using a file extension convention system with .yml, .dev.yml, .prod.yml and so on. This is fine if you don't have too much files. If you have even just 10 files for each, it's much more practical to use separate folders. To retake the example of what you can currently achieve with hautelook/AliceBundle, you can have:

DataFixtures
├── Prod
|   ├── DataLoader.php
|   ├── ...
|   └── fixtures.yml
├── Inte
|   ├── DataLoader.php
|   ├── ...
|   └── fixtures.yml
└── Dev
    ├── DataLoader.php
    ├── ...
    └── fixtures.yml

And keep things clear.

@theofidry theofidry changed the title Command usage Fixtures path Jul 10, 2015

@PedroTroller

This comment has been minimized.

Copy link
Member

commented Oct 28, 2015

@theofidry Thanks for your feedback. I totally agree with you, maybe the filter system can be more usefull if you can provide a pattern (ex: *.dev.yml ou Prod/*.yml).
And your idea to add a parameter to define the fixtures folder is good, but you have to keep the same convention between all bundles inside the same project...

@Einenlum

This comment has been minimized.

Copy link

commented Nov 1, 2015

I also like the idea of subdirectories. 👍

@PedroTroller PedroTroller added the ToDo label Jun 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.