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

Fixture directory structure #14

Open
Cryde opened this issue Jan 30, 2022 · 5 comments
Open

Fixture directory structure #14

Cryde opened this issue Jan 30, 2022 · 5 comments

Comments

@Cryde
Copy link

Cryde commented Jan 30, 2022

Hello,

I've struggled with this bundle because i've created a folder structure under the "fixtures" directory.

fixtures/user/user.yaml
fixtures/user/user_type.yaml
// etc

But after digging it seems that I can not do that because of :

$files = SymfonyFinder::create()->files()->in($fullPaths)->depth(0)->name('/.*\.(ya?ml|php)$/i');

In vendor/hautelook/alice-bundle/src/Locator/EnvDirectoryLocator.php:85

Is there a special reason to limit the depth ?

I will put my files at the root dir

@theofidry
Copy link
Owner

Is there a special reason to limit the depth ?

Yes! The reason is that it represents environments: https://github.com/theofidry/AliceBundle/blob/master/doc/advanced-usage.md#environment-specific-fixtures

I am not sure how this could be made either better/less confusing :/

@Cryde
Copy link
Author

Cryde commented Feb 1, 2022

Maybe load the environnement-less file first, with depth 0 and the per env with "infinite" depth ?
Anyway I solve this by simply prefixing files

(maybe we should put in the doc that it won't go in subdir in per env dir ?)

Thanks for your answers

@isxoqovbegzod
Copy link

not

@theofidry
Copy link
Owner

theofidry commented Jun 23, 2022

To be honest I'm not sure if it's because it was desired or to keep BC. I'm happy to change this but this requires some checking and probably a new major version. Maybe a flag could be added to enable this behaviour and add a deprecation message that this will become the default behaviour

@d0niek
Copy link

d0niek commented Aug 23, 2024

Support of subdirectories will be nice feature! ;-)

Load subdirectories by default (or with flag), env files put in fixtures/env/{prod,test,etc.}/ directory?

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

No branches or pull requests

4 participants