比如测试目录下有两个文件:
aTest.php
bTest.php
我希望它先加载 bTest.php ,再加载 aTest.php
按文档上说,只需要在 phpunit.xml 中指定即可:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./Index/base.php">
<testsuites>
<testsuite name="mytest">
<file>./Index/bTest.php</file>
<file>./Index/aTest.php</file>
</testsuite>
</testsuites>
</phpunit>
但当我运行
phpunit Index -v
时,提示使用了这个 phpunit.xml 文件,但加载文件的顺序并不是我指定的,怎么回事?
(我在 aTest.php 中需要依赖 bTest.php 某个测试方法的返回值。)