You are here

protected function FeedsReflectionTrait::getMethod in Feeds 8.3

Gets a ReflectionMethod for a class method.

Parameters

string $class: The class to reflect.

string $name: The method name to reflect.

Return value

\ReflectionMethod A ReflectionMethod.

2 calls to FeedsReflectionTrait::getMethod()
EventDispatcherTraitTest::test in tests/src/Unit/Event/EventDispatcherTraitTest.php
@covers ::getEventDispatcher @covers ::dispatchEvent
FeedTypeAccessControlHandlerTest::testCheckAccess in tests/src/Unit/FeedTypeAccessControlHandlerTest.php
@covers ::checkAccess

File

tests/src/Traits/FeedsReflectionTrait.php, line 24

Class

FeedsReflectionTrait
Trait for using reflection in tests.

Namespace

Drupal\Tests\feeds\Traits

Code

protected function getMethod($class, $name) {
  $class = new ReflectionClass($class);
  $method = $class
    ->getMethod($name);
  $method
    ->setAccessible(TRUE);
  return $method;
}