Class AdminPageFramework_ClassTester
Provides methods to test class methods including protected and private ones.
This is for test cases.
Usage
Retrieve a class instance with thegetInstance()
method. And with
it call methods to test using the call()
method.
Example
$_oClass = AdminPageFramework_ClassTester::getInstance( 'One' ); $_mValue = AdminPageFramework_ClassTester::call( $_oClass, // subject class object '_getString', // method name (private/protected supported) array( 'aaa' ) // method parameters ); var_dump( $_mValue ); class One { private function _getString( $sString ) { return $sString; } }
Package: AdminPageFramework\Utility
Since: 3.7.10
Remark: Requires PHP 5.3.0 or above.
Located at utility/class_tester/AdminPageFramework_ClassTester.php
Since: 3.7.10
Remark: Requires PHP 5.3.0 or above.
Located at utility/class_tester/AdminPageFramework_ClassTester.php
Methods summary
public static
object
|
#
getInstance( string $sClassName, array $aParameters = array() )
Creates an object instance with dynamic parameters. Parameters
Returnsobject An object instance of the class specified in the first parameter. Since
3.7.10
|
public static
|
#
call( object $oClass, string $sMethodName, array $aParameters )
Performs the method specified in the second parameter. Parameters
Since
3.7.10
Remark
This supports private methods to be executed.
|