Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 test parameters

Tags:

symfony

Is there a way to configure test parameters with Symfony2?

I tried importing parameters_test.yml from the config_test.yml file but the variables still come from the parameters.yml file which is imported by config.yml which is imported by config_dev.yml which is imported by config_test.yml.

Basically I want to setup different variables in a test parameter file so I can access the values and also use them in the config files. If I hardcode the variables directly into config_test.yml I don't have access to them.

The variable I'm interested in particular is database_name or doctrine->dbal->dbname.

Thanks

like image 880
tdbui22 Avatar asked Jun 01 '26 23:06

tdbui22


1 Answers

Of course ensure your two first lines your config_test.yml are:

imports:
    - { resource: config_dev.yml }
    - { resource: parameters_test.yml }
like image 80
Michele Carino Avatar answered Jun 06 '26 06:06

Michele Carino



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!