unit testing - How to set environment-specific parameters in Symfony bundle? -
i writing unit tests symfony2 controller uses service access external api. i've made mock subclass of service unit testing purposes, checks controller gives right input.
the config service in {bundle}/resources/config/parameters.yml
. @ moment overriding service class parameter in app/config/config_test.yml
unit tests use mock service.
i'd put test config somewhere in bundle if can, when make config_test.yml in {bundle}/resources/config
gets ignored. there way make work, or environment-specific config have stay under app directory?
i'll suggest use own loader in bundle. , depending on env load different yml file.
Comments
Post a Comment