【问题标题】:How to use phpunit in phing?如何在 phing 中使用 phpunit?
【发布时间】:2016-10-17 03:04:42
【问题描述】:

根据 How to use existing phpunit.xml in phing build.xml? 像这样在phing中使用phpunit.xml应该是可行的

 <phpunit configuration="./phpunit.xml">

但它是鼠标,不知道为什么?

这样的xml

<target name="test" description="Run PHPUnit tests" depends="prepare">
            <phpunit printsummary="true" configuration="./phpunit.xml" pharlocation="${pharlocation.dir}" ><!--configuration="./phpunit.xml"-->
                <formatter type="xml" todir="${xmlreport.dir}" outfile="${reportxml.dir}"/>
            </phpunit>
            <phpunitreport infile="${xmlreport.dir}/${reportxml.dir}" format="noframes" todir="${htmlreport.dir}" styledir="${xsl.dir}" />
</target>

运行结果是这样,phpunit不运行。我确认phing已经找到phpuntil.xml,当我改名时,phing会提示文件不存在。

自动测试 > 准备:

自动测试 > 测试:

[phpunit] 总测试运行:0,失败:0,错误:0,不完整:0, 跳过:0,经过时间:0.00033 s

构建完成

总时间:0.5406 秒

【问题讨论】:

  • 欢迎来到 SO。请不要发布指向代码或代码图像的链接——如果它位于图像文件中,任何人都无法复制您的代码以使用它。阅读this 以了解有关格式化问题的更多信息。您可以将代码粘贴到您的问题中,选择它,然后点击“{}”按钮缩进代码块。在此过程中,您可能会仔细阅读讨论的主题here
  • 使用phing --verbose查看运行的是什么phpunit命令

标签: php xml configuration phpunit phing


【解决方案1】:

您的 Phing 版本与最新的 PHPUnit 命名空间不兼容,请将 Phing 更新到 v3。

来源:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-08-01
    • 2017-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-29
    • 2014-08-31
    • 1970-01-01
    相关资源
    最近更新 更多