且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

zend 框架 2 + phpunit + 多个模块 + 持续集成

更新时间:2023-11-15 23:19:10

当我发现问题时忘记回答我自己的问题 我向我忘记的社区道歉......但为了大家的利益,我是如何得到它的工作.

I forgot to answer my own question when I figured it out I apologize to the community that I forgot... but for everyones benefit here is how I got it to work.

build.xml

<target name="phpunit" description="Run unit tests with PHPUnit">
    <apply executable="../vendor/bin/phpunit" parallel="false">
        <fileset dir="${env.WORKSPACE}/module" >
            <include name="**/test/phpunit.xml"/>
        </fileset>
        <arg value="--configuration" />
        <srcfile/>
    </apply>
</target>

以及每个模块的 phpunit.xml

And the phpunit.xml for each module

<phpunit bootstrap="Bootstrap.php">
    <testsuites>
        <testsuite name="Application">
            <directory>./</directory>
        </testsuite>
    </testsuites>

<!-- Filters only matter for code coverage reporting -->
    <filter>
        <blacklist>
            <directory>../../../vendor/</directory>
            <directory>./</directory>
            <file>../Module.php</file>
        </blacklist>
    </filter>
    <logging>
        <log type="coverage-html" target="../../../build/coverage" title="Application Module" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/>
        <log type="coverage-clover" target="../../../build/logs/clover-Application.xml"/>
        <log type="junit" target="../../../build/logs/junit-Application.xml" logIncompleteSkipped="false"/>
    </logging>
</phpunit>