You are here

public function TraverserTest::getProtectedMethod in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php \Masterminds\HTML5\Tests\Serializer\TraverserTest::getProtectedMethod()

Using reflection we make a protected method accessible for testing.

Parameters

string $name: The name of the method on the Traverser class to test.

Return value

\ReflectionMethod \ReflectionMethod for the specified method

File

vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php, line 35

Class

TraverserTest

Namespace

Masterminds\HTML5\Tests\Serializer

Code

public function getProtectedMethod($name) {
  $class = new \ReflectionClass('\\Masterminds\\HTML5\\Serializer\\Traverser');
  $method = $class
    ->getMethod($name);
  $method
    ->setAccessible(true);
  return $method;
}