# tasks/ext/phpunit/PHPUnitTestRunner.php

$Id: PHPUnitTestRunner.php 1354 2011-11-01 14:12:42Z 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.

## \PHPUnitTestRunner
jump to top

Package: phing\tasks\ext\phpunit

Simple Testrunner for PHPUnit that runs all tests of a testsuite.

Implements
Parent(s)
  \PHPUnit_Runner_BaseTestRunner
Author
  Michiel Rook
Since
  2.1.0
Version
  $Id: PHPUnitTestRunner.php 1354 2011-11-01 14:12:42Z mrook $

### Constants

`SUCCESS = 0`

`FAILURES = 1`

`ERRORS = 2`

`INCOMPLETES = 3`

`SKIPPED = 4`

### Properties

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

Type

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

Type

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

Type

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

Type

`$lastErrorMessage= ''''`
Default value`''`Details

Type

`$lastFailureMessage= ''''`
Default value`''`Details

Type

`$lastIncompleteMessage= ''''`
Default value`''`Details

Type

`$lastSkippedMessage= ''''`
Default value`''`Details

Type

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

Type

`$project= 'NULL'`
Default value `NULL` Details

Type

`$retCode= '0'`
Default value `0` Details

Type

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

Type

### Methods

`__construct( $project, $groups = array(), $excludeGroups = array(), $processIsolation = false ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$project |  |
$groups |  |
$excludeGroups |  |
$processIsolation |  |

`addError( \PHPUnit_Framework_Test $test, \Exception $e, float $time ) : void`

An error occurred.

Parameters

Name | Type | Description
--- | --- | ---
$test | \PHPUnit_Framework_Test |
$e | \Exception |
$time | float |

`addFailure( \PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, float $time ) : void`

A failure occurred.

Parameters

Name | Type | Description
--- | --- | ---
$test | \PHPUnit_Framework_Test |
$e | \PHPUnit_Framework_AssertionFailedError |
$time | float |

`addFormatter( $formatter ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$formatter |  |

`addIncompleteTest( \PHPUnit_Framework_Test $test, \Exception $e, float $time ) : void`

Incomplete test.

Parameters

Name | Type | Description
--- | --- | ---
$test | \PHPUnit_Framework_Test |
$e | \Exception |
$time | float |

`addSkippedTest( \PHPUnit_Framework_Test $test, \Exception $e, float $time ) : void`

Skipped test.

Parameters

Name | Type | Description
--- | --- | ---
$test | \PHPUnit_Framework_Test |
$e | \Exception |
$time | float |

Details

Since
  Method available since Release 3.0.0

`clearStatus( ) : void`
inherited

Inherited from: \PHPUnit_Runner_BaseTestRunner::clearStatus()
`composeMessage( $message, $test, $e ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$message |  |
$test |  |
$e |  |

`endTest( \PHPUnit_Framework_Test $test, float $time ) : void`

A test ended.

Parameters

Name | Type | Description
--- | --- | ---
$test | \PHPUnit_Framework_Test |
$time | float |

`endTestSuite( \PHPUnit_Framework_TestSuite $suite ) : void`

A test suite ended.

Parameters

Name | Type | Description
--- | --- | ---
$suite | \PHPUnit_Framework_TestSuite |

Details

Since
  Method available since Release 2.2.0

`getLastErrorMessage( ) : void`

`getLastFailureMessage( ) : void`

`getLastIncompleteMessage( ) : void`

`getLastSkippedMessage( ) : void`

`getLoader( ) : void`
inherited

Inherited from: \PHPUnit_Runner_BaseTestRunner::getLoader()
`getRetCode( ) : void`

`getTest( ) : void`
inherited

Inherited from: \PHPUnit_Runner_BaseTestRunner::getTest()
`handleError( $level, $message, $file, $line ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$level |  |
$message |  |
$file |  |
$line |  |

`loadSuiteClass( ) : void`
inherited

Inherited from: \PHPUnit_Runner_BaseTestRunner::loadSuiteClass()
`run( $suite ) : void`

Run a test

Parameters

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

`runFailed( string $message ) : void`

Override to define how to handle a failed loading of a test suite.

Parameters

Name | Type | Description
--- | --- | ---
$message | string |

`setCodecoverage( $codecoverage ) : void`

Parameters

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

`setUseCustomErrorHandler( $useCustomErrorHandler ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$useCustomErrorHandler |  |

`startTest( \PHPUnit_Framework_Test $test ) : void`

A test started.

Parameters

Name | Type | Description
--- | --- | ---
$test | \PHPUnit_Framework_Test |

`startTestSuite( \PHPUnit_Framework_TestSuite $suite ) : void`

A test suite started.

Parameters

Name | Type | Description
--- | --- | ---
$suite | \PHPUnit_Framework_TestSuite |

Details

Since
  Method available since Release 2.2.0

`testEnded( string $testName ) : void`

A test ended.

Parameters

Name | Type | Description
--- | --- | ---
$testName | string |

`testFailed( integer $status, \PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e ) : void`

A test failed.

Parameters

Name | Type | Description
--- | --- | ---
$status | integer |
$test | \PHPUnit_Framework_Test |
$e | \PHPUnit_Framework_AssertionFailedError |

`testStarted( string $testName ) : void`

A test started.

Parameters

Name | Type | Description
--- | --- | ---
$testName | string |

Documentation was generated by DocBlox 0.15.1.