【发布时间】:2015-01-15 21:28:44
【问题描述】:
我正在设置 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
最好的方法是什么?
谢谢。
【问题讨论】:
标签: symfony yaml codeception