使用Phing运行phpunit测试时出现错误

5

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时,它可以正常工作。


1
消息 unrecognized option -- b 显然来自PHPUnit。也许Phing任务使用它的方式不正确? - Joe
@Joe 是的,但我在想我是不是做错了?有什么办法可以找到选项 b 是什么,这可能有助于找到问题。 - Saumini Navaratnam
听起来很像这个问题。根据提到的提交,它可能适用于旧版本的PHPUnit (<4.8)。 - Joe
运行 phing -verbose 或者 phing -debug 可能会显示 phing 实际用于启动 phpunit 的选项。也许你会在那里找到你的 b - Joe
1个回答

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接