protected function ApiTestAbstract::invokeMethod in TMGMT Translator Smartling 8.2
Same name in this branch
- 8.2 api-sdk-php/tests/unit/ApiTestAbstract.php \Smartling\Tests\Unit\ApiTestAbstract::invokeMethod()
- 8.2 vendor/smartling/api-sdk-php/tests/unit/ApiTestAbstract.php \Smartling\Tests\Unit\ApiTestAbstract::invokeMethod()
Same name and namespace in other branches
- 8.4 vendor/smartling/api-sdk-php/tests/unit/ApiTestAbstract.php \Smartling\Tests\Unit\ApiTestAbstract::invokeMethod()
- 8.3 vendor/smartling/api-sdk-php/tests/unit/ApiTestAbstract.php \Smartling\Tests\Unit\ApiTestAbstract::invokeMethod()
Invokes protected or private method of given object.
Parameters
BaseApiAbstract $object: Object with protected or private method to invoke.
string $methodName: Name of the property to invoke.
array $parameters: Array of parameters to be passed to invoking method.
Return value
mixed Value invoked method will return or exception.
File
- api-sdk-php/
tests/ unit/ ApiTestAbstract.php, line 153
Class
- ApiTestAbstract
- Class ApiTestAbstract @package Smartling\Tests
Namespace
Smartling\Tests\UnitCode
protected function invokeMethod($object, $methodName, array $parameters = []) {
$reflection = new \ReflectionClass(get_class($object));
$method = $reflection
->getMethod($methodName);
$method
->setAccessible(true);
return $method
->invokeArgs($object, $parameters);
}