我有一个PHPunit.xml(PHPunit的配置文件),如下所示:
<PHPunit backupGlobals="false" backupStaticAttributes="false" bootstrap="./tests/bootstrap.PHP" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" strict="true" verbose="true" colors="true"> <testsuites> <testsuite name="My Tests"> <directory>./tests</directory> </testsuite> </testsuites> </PHPunit>
正如DRY所说,我不想简单地复制&将PHPunit.xml的内容粘贴到我的build.xml,以便使用相同的配置运行PHPunit.
我在Phing的build.xml中的目标如下所示:
<target name="unit-test"> <PHPunit printsummary="true" /> </target>
即使那个PHPunit应该自动找到PHPunit.xml(当我手动启动它就像输入“PHPunit”到我的终端并按下回车,它可以工作)并使用它,在phing的情况下,输出看起来像这样:
[PHPunit] Total tests run: 0,Failures: 0,Errors: 0,Incomplete: 0,Skipped: 0,Time elapsed: 0.00122 s
那么有什么方法,如何达到描述的行为?