加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 23:23:30 所属栏目:百科 来源:网络整理
导读:我有一个phpunit.xml(phpunit的配置文件),如下所示: phpunit backupGlobals="false" backupStaticAttributes="false" bootstrap="./tests/bootstrap.php" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions
我有一个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"/>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读