gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:01:16 24 4
gpt4 key购买 nike

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

我在 build.xml 中的 Phing 目标如下所示:

<target name="unit-test">
<phpunit printsummary="true" />
</target>

甚至那个 phpunit 应该会自动找到 phpunit.xml(当我手动启动它就像在我的终端输入“phpunit”并按下 enter,它工作)并使用它,在 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 - 如何在 phing build.xml 中使用现有的 phpunit.xml?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11824932/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com