# classes/phing/tasks/ext/phpunit/PHPUnitTestRunner.php

## \PHPUnitTestRunner
jump to top

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

Extends from
  \PHPUnit_Runner_BaseTestRunner
Implements
author
  Michiel Rook
package
  phing.tasks.ext.phpunit
since
  2.1.0
version
  $Id: PHPUnitTestRunner.php 1229 2011-07-25 19:54:19Z mrook $

### Constants

`SUCCESS = '0'`

`FAILURES = '1'`

`ERRORS = '2'`

`INCOMPLETES = '3'`

`SKIPPED = '4'`

### Properties

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

Type

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

Type

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

Type

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

Type

`$lastErrorMessage= ''`
Details

Type

`$lastFailureMessage= ''`
Details

Type

`$lastIncompleteMessage= ''`
Details

Type

`$lastSkippedMessage= ''`
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 ) :`
Parameters

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

`addError( \PHPUnit_Framework_Test $test, \Exception $e, float $time ) :`
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 ) :`
A failure occurred.
Parameters

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

`addFormatter( $formatter ) :`
Parameters

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

`addIncompleteTest( \PHPUnit_Framework_Test $test, \Exception $e, float $time ) :`
Incomplete test.
Parameters

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

`addSkippedTest( \PHPUnit_Framework_Test $test, \Exception $e, float $time ) :`
Skipped test.
Parameters

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

Details

since
  Method available since Release 3.0.0

`clearStatus( ) :`
Inherited from:
`composeMessage( $message, $test, $e ) :`
Parameters

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

`endTest( \PHPUnit_Framework_Test $test, float $time ) :`
A test ended.
Parameters

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

`endTestSuite( \PHPUnit_Framework_TestSuite $suite ) :`
A test suite ended.
Parameters

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

Details

since
  Method available since Release 2.2.0

`getLastErrorMessage( ) :`
`getLastFailureMessage( ) :`
`getLastIncompleteMessage( ) :`
`getLastSkippedMessage( ) :`
`getLoader( ) :`
Inherited from:
`getRetCode( ) :`
`getTest( ) :`
Inherited from:
`handleError( $level, $message, $file, $line ) :`
static
Parameters

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

`loadSuiteClass( ) :`
Inherited from:
`run( $suite ) :`
Run a test
Parameters

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

`runFailed( string $message ) :`
Override to define how to handle a failed loading of a test suite.
Parameters

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

`setCodecoverage( $codecoverage ) :`
Parameters

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

`setUseCustomErrorHandler( $useCustomErrorHandler ) :`
Parameters

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

`startTest( \PHPUnit_Framework_Test $test ) :`
A test started.
Parameters

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

`startTestSuite( \PHPUnit_Framework_TestSuite $suite ) :`
A test suite started.
Parameters

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

Details

since
  Method available since Release 2.2.0

`testEnded( string $testName ) :`
A test ended.
Parameters

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

`testFailed( integer $status, \PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e ) :`
A test failed.
Parameters

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

`testStarted( string $testName ) :`
A test started.
Parameters

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

Documentation was generated by DocBlox 0.13.1.