运行测试时,PHPUnit 正在加载我的 phpunit.xml。我可以在控制台中看到它作为 --bootstrap参数,但它似乎没有被执行?
在 xml 中,我设置xml 文件内容在 下方和上方回bootstrap="bootstrap.php"
显是否正常?我刚刚放入的 bootstrap.php 文件中的任何方式line Testing started at...PHPUnit 3.7.21 by Sebastian Bergmann.
die "bootstrap executed";
Run Code Online (Sandbox Code Playgroud)
但从来没有看到过。可能出什么问题了?
编辑:这是 phpunit.xml 的内容:
<phpunit bootstrap="./bootstrap.php">
</phpunit>
Run Code Online (Sandbox Code Playgroud)
您需要在以下示例之一中启动 phpunit:
#for load a bootstrap php file (with full path and file extension)
>phpunit --bootstrap bootstrap.php
Run Code Online (Sandbox Code Playgroud)
或者
#for load with your xml configuration
>phpunit -c phpunit.xml
Run Code Online (Sandbox Code Playgroud)
希望这有帮助