使用Phing运行phpunit测试时出错

时间:2017-03-15 04:34:39

标签: jenkins phpunit phing

詹金斯版本 - 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>
...

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

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

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

1 个答案:

答案 0 :(得分:0)

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

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

相关问题