PHP Class TestBase, paratest

显示文件 Open project: brianium/paratest Class Usage Examples

Public Methods

Method Description
call ( Object $object, string $methodName, mixed $args = null ) : mixed Calls an object method even if it is protected or private
callStatic ( string $class, string $methodName, mixed $args = null ) : mixed Calls a class method even if it is protected or private

Protected Methods

Method Description
_callMethod ( $objectOrClassName, $methodName, $args = null )
copyCoverageFile ( string $fixture, string $directory = '/tmp' ) : string Copy fixture file to tmp folder, cause coverage file will be deleted by merger
findTests ( $dir )
fixture ( $fixture )
getObjectValue ( $object, $property )
getPhpUnitVersion ( ) : string Get PHPUnit version
removeDirectory ( string $dirname ) Remove dir and its files
setObjectValue ( $object, $property, $value )
skipIfCodeCoverageNotEnabled ( )

Private Methods

Method Description
getAccessibleProperty ( $object, $property )

Method Details

_callMethod() protected static method

protected static _callMethod ( $objectOrClassName, $methodName, $args = null )

call() public method

Calls an object method even if it is protected or private
public call ( Object $object, string $methodName, mixed $args = null ) : mixed
$object Object the object to call a method on
$methodName string the method name to be called
$args mixed 0 or more arguments passed in the function
return mixed returns what the object's method call will return

callStatic() public method

Calls a class method even if it is protected or private
public callStatic ( string $class, string $methodName, mixed $args = null ) : mixed
$class string the class to call a method on
$methodName string the method name to be called
$args mixed 0 or more arguments passed in the function
return mixed returns what the object's method call will return

copyCoverageFile() protected method

Copy fixture file to tmp folder, cause coverage file will be deleted by merger
protected copyCoverageFile ( string $fixture, string $directory = '/tmp' ) : string
$fixture string Fixture coverage file name
$directory string
return string Copied coverage file

findTests() protected method

protected findTests ( $dir )

fixture() protected method

protected fixture ( $fixture )

getObjectValue() protected method

protected getObjectValue ( $object, $property )

getPhpUnitVersion() protected static method

Get PHPUnit version
protected static getPhpUnitVersion ( ) : string
return string

removeDirectory() protected method

Remove dir and its files
protected removeDirectory ( string $dirname )
$dirname string

setObjectValue() protected method

protected setObjectValue ( $object, $property, $value )

skipIfCodeCoverageNotEnabled() protected static method

protected static skipIfCodeCoverageNotEnabled ( )