2012-03-15 54 views
1

嗨即時通訊在Zend Framework 1.8 Web應用程序開發書稱爲店面做一個小應用程序。ZEND框架&PHPUnit與螞蟻有「無法識別的選項 - 報告」

我已經安裝了PHPUnit,版本是Sebastian Bergmann的PHPUnit 3.6.10。還我安裝了Apache的螞蟻。

爲我的電子書我創建了一個build文件夾,並通過CMD (文件夾包含ant.properties,build.xml文件的文件)運行此文件夾內的螞蟻命令

我有一個構建失敗消息時執行Ant命令,有在試驗段的消息「無法識別的選項--report」

,這裏是我的build.xml

<?xml version="1.0" encoding="UTF-8"?> 
<project name="StoreFront" default="build" basedir="../"> 

    <target name="getProps"> 
     <property file="${basedir}/build/ant.properties" /> 

     <condition property="script-suffix" value=".bat" else=""> 
      <os family="windows" /> 
     </condition> 

     <echo message="---- Build Properties ----" /> 
     <echo message="" /> 

     <echo message="OS is ${os.name}" /> 
     <echo message="Basedir is ${basedir}" /> 
     <echo message="Property file is ${basedir}/build/ant.properties" /> 
     <echo message="Script-suffix is ${script-suffix}" /> 

     <echo message="" /> 
     <echo message="---- Storefront Properties ----" /> 
     <echo message="" /> 

     <echo message="Environment is ${environment}" />  

    </target> 

    <target name="test" depends="getProps"> 
     <exec dir="${basedir}/tests" executable="phpunit${script-suffix}" failonerror="true"> 
      <arg line="--colors --report ${basedir}/build/report 
      --log-xml ${basedir}/build/logs/phpunit.xml 
      --log-pmd ${basedir}/build/logs/phpunit.pmd.xml 
      --log-metrics ${basedir}/build/logs/phpunit.metrics.xml 
      --coverage-xml ${basedir}/build/logs/phpunit.coverage.xml 
      AllTests.php"/> 
     </exec> 
    </target> 

    <target name="configure" depends="getProps"> 
     <copy file="${basedir}/application/application.php.dist" 
      tofile="${basedir}/application/application.php" overwrite="true" /> 
     <replace file="${basedir}/application/application.php" token="@[email protected]" value="${environment}" /> 
    </target> 

    <target name="buildPreparation"> 
     <mkdir dir="${basedir}/build/logs" /> 
     <mkdir dir="${basedir}/build/report" /> 
    </target> 

    <target name="clean"> 
     <delete dir="${basedir}/build/logs" /> 
     <delete dir="${basedir}/build/report" /> 
    </target> 

    <target name="build" depends="buildPreparation,configure,test"/> 
</project> 

這是我在cmd中得到的消息

C:\wamp\www\storefront\build>ant 
Buildfile: C:\wamp\www\storefront\build\build.xml 

buildPreparation: 

getProps: 
    [echo] ---- Build Properties ---- 
    [echo] 
    [echo] OS is Windows 7 
    [echo] Basedir is C:\wamp\www\storefront 
    [echo] Property file is C:\wamp\www\storefront/build/ant.properties 
    [echo] Script-suffix is .bat 
    [echo] 
    [echo] ---- Storefront Properties ---- 
    [echo] 
    [echo] Environment is development 

configure: 
    [copy] Copying 1 file to C:\wamp\www\storefront\application 

test: 
    [exec] PHPUnit 3.6.10 by Sebastian Bergmann. 
    [exec] 
    [exec] unrecognized option --report 

BUILD FAILED 
C:\wamp\www\storefront\build\build.xml:28: exec returned: 1 

Total time: 0 seconds 

C:\wamp\www\storefront\build>phpunit --version 
PHPUnit 3.6.10 by Sebastian Bergmann. 

我怎麼能固定這一項我只是按照書

回答

2

--report步驟不是PHPUnit的3.6一個有效的命令行開關。

請閱讀有效選項手動 - http://www.phpunit.de/manual/current/en/textui.html#textui.clioptions

+0

thnks我cheanged,但請ü可以告訴我,我如何在3.6 --log-PMD $ {BASEDIR} /建設/日誌寫這兩個命令/phpunit.pmd.xml --log-metrics $ {basedir} /build/logs/phpunit.metrics.xml – 2012-03-15 05:49:41