You are here

protected function ApiTestAbstract::invokeMethod in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.2 api-sdk-php/tests/unit/ApiTestAbstract.php \Smartling\Tests\Unit\ApiTestAbstract::invokeMethod()
  2. 8.2 vendor/smartling/api-sdk-php/tests/unit/ApiTestAbstract.php \Smartling\Tests\Unit\ApiTestAbstract::invokeMethod()
  3. 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.

20 calls to ApiTestAbstract::invokeMethod()
AuditLogApiTest::prepareAuditLogApiMock in vendor/smartling/api-sdk-php/tests/unit/AuditLogApiTest.php
AuthApiTest::testAuthenticate in vendor/smartling/api-sdk-php/tests/unit/AuthApiTest.php
Test auth method.
AuthApiTest::testAuthenticateWithInvalidCredentials in vendor/smartling/api-sdk-php/tests/unit/AuthApiTest.php
Test auth with invalid credentials.
BaseApiAbstractTest::testClientIdAndClientVersionAndUserAgentExtensionsSpecified in vendor/smartling/api-sdk-php/tests/unit/BaseApiAbstractTest.php
Test custom client id, version and extension in user agent.
BaseApiAbstractTest::testCurrentClientIdAndVersionSpecifiedUserAgentExtensionNotSpecified in vendor/smartling/api-sdk-php/tests/unit/BaseApiAbstractTest.php
Test custom client id and version in user agent.

... See full list

File

vendor/smartling/api-sdk-php/tests/unit/ApiTestAbstract.php, line 158

Class

ApiTestAbstract
Class ApiTestAbstract @package Smartling\Tests

Namespace

Smartling\Tests\Unit

Code

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);
}