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
Various utility functions
- Author
- Michiel Rook
- Since
- 2.1.0
- Version
- $Id: PHPUnitUtil.php 792 2010-06-24 12:56:45Z mrook $
Properties
Methods

getClassFromFileName(
string $filename
)
:
stringDerives 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.
| Name | Type | Description |
|---|---|---|
| $filename | string | the filename |
| Type | Description |
|---|---|
| string | the name fo the class |

getDefinedClasses(
string $filename, \Path $classpath
=
NULL
)
:
array| Name | Type | Description |
|---|---|---|
| $filename | string | the filename |
| $classpath | \Path | optional classpath |
| Type | Description |
|---|---|
| array | list of classes defined in the file |

getPackageName(
string $classname
)
:
stringReturns the package of a class as defined in the docblock of the class using @package
| Name | Type | Description |
|---|---|---|
| $classname | string | the name of the class |
| Type | Description |
|---|---|
| string | the name of the package |

getSubpackageName(
string $classname
)
:
string | nullReturns the subpackage of a class as defined in the docblock of the class using @subpackage
| Name | Type | Description |
|---|---|---|
| $classname | string | the name of the class |
| Type | Description |
|---|---|
| string | null | the name of the subpackage |
- Author
- Benjamin Schultz