Phpunit task

Phpunit task

Description

Task to process phpunit (see: phpunit.de).

Installation

Please install (linux debian): $ apt-get install phpunit

Phpunit task parameters

Attribute Description Value Required
file The test file <Path/To/FileTest.php> yes, if dir is undefined
class The class name \Path\To\FileTest yes, if file is defined
dir The test directory yes, if file is undefined
configuration The configuration file check dir/phpunit.xml by default, if dir is defined no
failonerror Fail on error false by default no
todir The result directory no

Examples

<project name="phpunit task"> 

  <taskdef name="phpunit" 
       classname="net.sourceforge.ant4x.taskdefs.php.PhpunitTask" 
       classpath="PATH/TO/ant4x.jar"/> 

  <target name="phpunit"> 
    <phpunit dir="tests" configuration="tests/config2.xml" failonerror="true" todir="tmp/phpunit" />
    <phpunit file="tests/My/Lib/PhpTest.php" class="My_Lib_Php" />
  </target> 

</project>