# tasks/ext/phpunit/BatchTest.php

$Id: BatchTest.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.

## \BatchTest
jump to top

Package: phing\tasks\ext\phpunit

Scans a list of files given by the fileset attribute, extracts valid test cases

Author
  Michiel Rook
Since
  2.1.0
Version
  $Id: BatchTest.php 1353 2011-11-01 14:12:20Z mrook $

### Properties

`$classpath= 'NULL'`

the classpath to use with Phing::__import() calls

Default value `NULL` Details

Type
  n/a

`$excludeClasses= 'array()'`

names of classes to exclude

Default value `array()`Details

Type
  n/a

`$filesets= 'array()'`

the list of filesets containing the testcase filename rules

Default value `array()`Details

Type
  n/a

`$name= '"Phing Batchtest"'`

name of the batchtest/suite

Default value`"Phing Batchtest"`Details

Type
  n/a

`$project= 'NULL'`

the reference to the project

Default value `NULL` Details

Type
  n/a

### Methods

`__construct( \Project $project ) : void`

Create a new batchtest instance

Parameters

Name | Type | Description
--- | --- | ---
$project | \Project | the project it depends on.

`addFileSet( \FileSet $fileset ) : void`

Add a new fileset containing the XML results to aggregate

Parameters

Name | Type | Description
--- | --- | ---
$fileset | \FileSet | the new fileset containing XML results.

`addToTestSuite( \PHPUnit_Framework_TestSuite $suite ) : void`

Add the tests in this batchtest to a test suite

Parameters

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

`createClasspath( ) : void`

Creates a new Path object

`elements( ) : array`

Returns an array of test cases and test suites that are declared by the files included by the filesets

Returns

Type | Description
--- | ---
array | an array of tests.

`filterTests( $input ) : void`

Filters an array of classes, removes all classes that are not test cases or test suites, or classes that are declared abstract

Parameters

Name | Type | Description
--- | --- | ---
$input |  |

`getClasspath( ) : void`

Returns the classpath

`getFilenames( ) : array`

Iterate over all filesets and return the filename of all files.

Returns

Type | Description
--- | ---
array | an array of filenames

`getTestSuite( ) : \PHPUnit_Framework_TestSuite`

Returns a testsuite containing all the tests in this batch

Returns

Type | Description
--- | ---
\PHPUnit_Framework_TestSuite |

Details

Deprecated

`isTestCase( $input ) : void`

Checks wheter $input is a PHPUnit Test

Parameters

Name | Type | Description
--- | --- | ---
$input |  |

`setClasspath( $classpath ) : void`

Sets the classpath

Parameters

Name | Type | Description
--- | --- | ---
$classpath |  |

`setExclude( $exclude ) : void`

Sets the classes to exclude

Parameters

Name | Type | Description
--- | --- | ---
$exclude |  |

`setName( $name ) : void`

Sets the name of the batchtest/suite

Parameters

Name | Type | Description
--- | --- | ---
$name |  |

Documentation was generated by DocBlox 0.17.1.