# tasks/ext/phpunit/PHPUnitTask.php

$Id: PHPUnitTask.php 1353 2011-11-01 14:12:20Z mrook $

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals and is licensed under the LGPL. For more information please see http://phing.info.

## \PHPUnitTask
jump to top

Package: phing\tasks\ext\phpunit

Runs PHPUnit tests.

Parent(s)
  \Task < \ProjectComponent
See
  \BatchTest
Author
  Michiel Rook
Since
  2.1.0
Version
  $Id: PHPUnitTask.php 1353 2011-11-01 14:12:20Z mrook $

### Properties

`$batchtests= 'array()'`
Default value `array()`Details

Type
  n/a

`$bootstrap= '""'`
Default value`""`Details

Type
  n/a

`$codecoverage= 'null'`
Default value `null` Details

Type
  n/a

`$errorproperty= ''`
Details

Type
  n/a

`$excludeGroups= 'array()'`
Default value `array()`Details

Type
  n/a

`$failureproperty= ''`
Details

Type
  n/a

`$formatters= 'array()'`
Default value `array()`Details

Type
  n/a

`$groups= 'array()'`
Default value `array()`Details

Type
  n/a

`$haltonerror= 'false'`
Default value `false` Details

Type
  n/a

`$haltonfailure= 'false'`
Default value `false` Details

Type
  n/a

`$haltonincomplete= 'false'`
Default value `false` Details

Type
  n/a

`$haltonskipped= 'false'`
Default value `false` Details

Type
  n/a

`$incompleteproperty= ''`
Details

Type
  n/a

`$printsummary= 'false'`
Default value `false` Details

Type
  n/a

`$processIsolation= 'false'`
Default value `false` Details

Type
  n/a

`$skippedproperty= ''`
Details

Type
  n/a

`$testfailed= 'false'`
Default value `false` Details

Type
  n/a

`$testfailuremessage= '""'`
Default value`""`Details

Type
  n/a

`$usecustomerrorhandler= 'true'`
Default value `true` Details

Type
  n/a

### Methods

`addFormatter( \FormatterElement $fe ) : void`

Add a new formatter to all tests of this task.

Parameters

Name | Type | Description
--- | --- | ---
$fe | \FormatterElement | formatter element

`createBatchTest( ) : \BatchTest`

Adds a set of tests based on pattern matching.

Returns

Type | Description
--- | ---
\BatchTest | a new instance of a batch test.

`execute( $suite ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$suite |  |

Throws

Exception | Description
--- | ---
\BuildException |

`getDefaultOutput( ) : void`

`getDescription( ) : void`

`getHaltonfailure( ) : void`

`getHaltonincomplete( ) : void`

`getHaltonskipped( ) : void`

`getLocation( ) : void`

`getOwningTarget( ) : void`

`getProject( ) : void`

`getRegisterSlot( ) : void`

`getRuntimeConfigurableWrapper( ) : void`

`getTaskName( ) : void`

`getTaskType( ) : void`

`init( ) : void`

Initialize Task.

This method includes any necessary PHPUnit libraries and triggers appropriate error if they cannot be found. This is not done in header because we may want this class to be loaded w/o triggering an error.

`log( ) : void`

`main( ) : void`

The main entry point

Throws

Exception | Description
--- | ---
\BuildException |

`maybeConfigure( ) : void`

`perform( ) : void`

`setBootstrap( string $bootstrap ) : void`

Sets the name of a bootstrap file that is run before executing the tests

Parameters

Name | Type | Description
--- | --- | ---
$bootstrap | string | the name of the bootstrap file

`setCodecoverage( $codecoverage ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$codecoverage |  |

`setDescription( ) : void`

`setErrorproperty( $value ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

`setExcludeGroups( $excludeGroups ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$excludeGroups |  |

`setFailureproperty( $value ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

`setGroups( $groups ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$groups |  |

`setHaltonerror( $value ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

`setHaltonfailure( $value ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

`setHaltonincomplete( $value ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

`setHaltonskipped( $value ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

`setIncompleteproperty( $value ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

`setLocation( ) : void`

`setOwningTarget( ) : void`

`setPrintsummary( $printsummary ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$printsummary |  |

`setProcessIsolation( $processIsolation ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$processIsolation |  |

`setProject( ) : void`

`setRuntimeConfigurableWrapper( ) : void`

`setSkippedproperty( $value ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

`setTaskName( ) : void`

`setTaskType( ) : void`

`setUseCustomErrorHandler( $usecustomerrorhandler ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$usecustomerrorhandler |  |

Documentation was generated by DocBlox 0.17.1.