如何在phing build.xml中使用现有的phpunit.xml?

我有一个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

那么有什么方法,如何达到描述的行为?

解决方法

这可能是 since phing 2.4.13与 configuration属性

<PHPunit configuration="path/to/PHPunit.xml"/>

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念