You are here

protected function DemoImageTest::invokeMethod in Panopoly 8.2

Invokes a normally inaccessible method.

Parameters

object $object: Object to invoke the method on.

string $method: The name of the method.

array $arguments: The arguments to pass to the method.

Return value

mixed The result of the invoked method.

1 call to DemoImageTest::invokeMethod()
DemoImageTest::testGetOptionalProperty in modules/panopoly/panopoly_core/tests/src/Unit/Plugin/migrate/process/DemoImageTest.php
Tests the getOptionalProperty() method.

File

modules/panopoly/panopoly_core/tests/src/Unit/Plugin/migrate/process/DemoImageTest.php, line 118

Class

DemoImageTest
Tests for the 'panopoly_demo_image' migrate process plugin.

Namespace

Drupal\Tests\panopoly_core\Unit\Plugin\migrate\process

Code

protected function invokeMethod($object, $method, array $arguments = []) {
  $method = new \ReflectionMethod(get_class($object), $method);
  $method
    ->setAccessible(TRUE);
  return $method
    ->invokeArgs($object, $arguments);
}