You are here

protected function SmartlingTestBase::invokeMethod in TMGMT Translator Smartling 8.4

Same name in this branch
  1. 8.4 tests/src/Functional/SmartlingTestBase.php \Drupal\Tests\tmgmt_smartling\Functional\SmartlingTestBase::invokeMethod()
  2. 8.4 tests/src/Kernel/SmartlingTestBase.php \Drupal\Tests\tmgmt_smartling\Kernel\SmartlingTestBase::invokeMethod()
Same name and namespace in other branches
  1. 8.3 tests/src/Functional/SmartlingTestBase.php \Drupal\Tests\tmgmt_smartling\Functional\SmartlingTestBase::invokeMethod()

Invokes private/protected method.

Parameters

$object:

$methodName:

array $parameters:

Return value

mixed

2 calls to SmartlingTestBase::invokeMethod()
PushBackControllerTest::testUseCallbackUrlDoNotOverrideHost in tests/src/Functional/PushBackControllerTest.php
Use callback url. Do not override host.
PushBackControllerTest::testUseCallbackUrlOverrideHost in tests/src/Functional/PushBackControllerTest.php
Use callback url. Override host.

File

tests/src/Functional/SmartlingTestBase.php, line 122

Class

SmartlingTestBase
Basic tests for the Smartling translator.

Namespace

Drupal\Tests\tmgmt_smartling\Functional

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