# tasks/ext/phpunit/PHPUnitUtil.php

$Id: PHPUnitUtil.php 792 2010-06-24 12:56:45Z 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.

## \PHPUnitUtil
jump to top

Package: phing\tasks\ext\phpunit

Various utility functions

Author
  Michiel Rook
Since
  2.1.0
Version
  $Id: PHPUnitUtil.php 792 2010-06-24 12:56:45Z mrook $

### Properties

`$definedClasses= 'array()'`
static
Default value `array()`Details

Type

### Methods

`getClassFromFileName( string $filename ) : string`
static

Derives the classname from a filename.

Assumes that there is only one class defined in that particular file, and that the naming follows the dot-path (Java) notation scheme.

Parameters

Name | Type | Description
--- | --- | ---
$filename | string | the filename

Returns

Type | Description
--- | ---
string | the name fo the class

`getDefinedClasses( string $filename, \Path $classpath = NULL ) : array`
static

Parameters

Name | Type | Description
--- | --- | ---
$filename | string | the filename
$classpath | \Path | optional classpath

Returns

Type | Description
--- | ---
array | list of classes defined in the file

`getPackageName( string $classname ) : string`
static

Returns the package of a class as defined in the docblock of the class using @package

Parameters

Name | Type | Description
--- | --- | ---
$classname | string | the name of the class

Returns

Type | Description
--- | ---
string | the name of the package

`getSubpackageName( string $classname ) : string|null`
static

Returns the subpackage of a class as defined in the docblock of the class using @subpackage

Parameters

Name | Type | Description
--- | --- | ---
$classname | string | the name of the class

Returns

Type | Description
--- | ---
string|null | the name of the subpackage

Details

Author
  Benjamin Schultz

Documentation was generated by DocBlox 0.15.1.