[英]Php unit testing pass config file from command
我正在通過使用單元測試來實現一些集成測試。 我正在使用setUp()
方法來設置配置文件。 我的配置文件由一些Api keys
API secret
等組成。這很好用。
public function setUp()
{
$this->_pipeline = new Pipline($this);
$this->_pipeline->setConfig(\Api\Models\ConfigModel::createFromFile(__DIR__ . '/test/integration/assets/config'));
$users = $this->_pipeline->users->listUsers();
$this->_userId = $users->result->data[0]->user_id;
parent::setUp();
}
這種方法以這種方式運作良好。
問題但是我想從命令中傳遞配置文件。 目前我正在使用此命令
php ./vendor/phpunit/phpunit/phpunit -c ./test/integration/phpunit.xml
有沒有辦法我可以從命令這樣傳遞
php ./vendor/phpunit/phpunit/phpunit -c ./test/integration/phpunit.xml -c2 / test / integration / assets / config
提前致謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.