我正在设置Codeception的Db模块,并希望使用Symfony 2的parameters.yml文件中的参数。
基本上是这样的:
paths: tests: tests log: tests/_log data: tests/_data helpers: tests/_helpers settings: bootstrap: _bootstrap.php suite_class: \PHPUnit_Framework_TestSuite colors: true memory_limit: 1024M log: true modules: config: Symfony2: app_path: 'app' var_path: 'app' environment: 'test' Db: dsn: "mysql:host='%test_database_host%';dbname='%test_database_name%'" user: "%test_database_user%" password: "%test_database_password%" dump: tests/_data/test_data.sql
占位符(例如%test_database_user%)不会被Symfony 2的app / config目录中的parameters.yml文件中的值替换。
parameters.yml:
parameters: test_database_name: testdb test_database_host: 127.0.0.1 test_database_user: root test_database_password: thisismypassword
最好的方法是什么?
谢谢。