【问题标题】:Error running phpunit test using Phing使用 Phing 运行 phpunit 测试时出错
【发布时间】:2017-08-05 16:25:44
【问题描述】:

Jenkins 版本 - 2.22

Phing 版本 - 0.13.3

PHPUnit 版本 - 5.7.19

phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="bootstrap/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="Application Test Suite">
            <directory suffix="Test.php">./tests</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app/Managers</directory>
        </whitelist>
    </filter>
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="QUEUE_DRIVER" value="sync"/>
    </php>
</phpunit>

build.xml

...
<coverage-setup database="./report/coverage/database">
    <fileset id="coverageFileSet" dir="./app/Managers">
        <include name="**/*Manager*.php" />
    </fileset>
</coverage-setup>
<phpunit pharlocation="./vendor/phpunit/phpunit/phpunit" configuration="./phpunit.xml" printsummary="true" haltonerror="true" haltonfailure="true" codecoverage="true">
    <formatter type="clover" outfile="report/coverage/clover.xml"/>
</phpunit>
<coverage-report outfile="report/coverage/coverage.xml">
    <report todir="report/coverage"/>
</coverage-report>
...

当我在Jenkins 中运行phing 目标时,出现以下错误。 unrecognized option -- b

我做错了什么?或任何帮助如何调试此问题?

注意 - 这是 laravel-5.4 应用程序,当我从应用程序的根文件夹运行 phpunit 时,它正在工作。

【问题讨论】:

  • 消息unrecognized option -- bobviously originates from PHPUnit。也许 Phing 任务以错误的方式使用它?
  • @Joe 是的,但我想知道我做错了吗?无论如何我能找到那个选项b,它可能有助于找到问题
  • 听起来很像Issue。根据commit mentioned there,它可能适用于旧版本的 PHPUnit (
  • 运行phing -verbose 甚至phing -debug 可能会显示phing 实际用于启动phpunit 的选项。也许你会在那里找到你的b

标签: jenkins phpunit phing


【解决方案1】:

您说您使用的是 Phing 版本 - 0.13.3,这不太合理。您应该尝试使用 Phing 3.0.0-alpha3,它有很多改进。

另外,我认为以下答案可以帮助你:Phing and PHPUnit, just cant get even the most basic thing running

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-23
    • 1970-01-01
    • 2014-05-08
    • 1970-01-01
    • 2011-04-18
    • 2012-03-22
    • 2015-06-26
    • 2012-04-09
    相关资源
    最近更新 更多