-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
[POC] Refactor static state #8
Conversation
- make Manager constructor arguments required - remove Manager::boot() - make Manager/StoryManager services - call Factory::boot() in ZenstruckFoundryBundle::boot()
- add test to ensure stories as services are loaded correctly
- proxies created in global state would have a different "Manager" than the one used in your tests causing the om to think these were not persisted. Always grabbing the current manager from Factory::manager() solves this. - also removed injecting into RepositoryProxy to be consistent.
- using without bundle must be explicitly configured
I renamed I also merged |
I renamed |
One thing that kind of sucks is if you want your dev and test config to match, you have to duplicate it in Maybe the recipe could try to solve this by having the test config import the dev? |
Attempt to make foundry configurable with the bundle. Still allows foundry to be used without the bundle.
TODO:
Manager
,StoryManager
,Faker
,Instantiator
)ZenstruckFoundryBundle::boot()
? This will allow using factories/stories in your doctrine fixtures with zero config.tests/bootstrap.php
). I'm thinking of aConfiguration
static class withsetFaker()
/setInstantiator()
methods. When booting, if this has been configured, it takes precedence over bundle config. (ensure works withGlobalState
)