手冊中說phpunit -d key=val
允許任何在ini文件中有效的設置。完全相同的描述php -d
phpunit -d標誌限制?
但對我來說,它沒有做任何事情。單獨使用PHP
測試:
$ cat test.php
<?php
var_dump(get_cfg_var('hello'));
?>
$ php -d hello=world test.php
string(5) "world"
都好!現在我得到什麼phpunit:
$ cat test.php
<?php
class MyTest extends PHPUnit_Framework_TestCase {
public function testA(){
var_dump(get_cfg_var('hello'));
}
}
?>
$ phpunit -d hello=world test.php
PHPUnit 3.7.35 by Sebastian Bergmann.
.bool(false)
我怎麼能通過cfunit通過命令行phpunit?
你們已經看到[這](https://github.com/sebastianbergmann/phpunit/issues/940)?我不知道這是否可以成爲您的解決方法... – Matteo