protected function ViewExecutableTest::getProtectedProperty

Returns a protected property from a class instance.

Parameters

object $instance: The class instance to return the property from.

string $property: The name of the property to return.

Return value

mixed The instance property value.

1 call to ViewExecutableTest::getProtectedProperty()
ViewExecutableTest::assertViewDestroy in drupal/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php
Asserts that expected view properties have been unset by destroy().

File

drupal/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php, line 337
Contains \Drupal\views\Tests\ViewExecutableTest.

Class

ViewExecutableTest
Tests the ViewExecutable class.

Namespace

Drupal\views\Tests

Code

protected function getProtectedProperty($instance, $property) {
  $reflection = new \ReflectionProperty($instance, $property);
  $reflection
    ->setAccessible(TRUE);
  return $reflection
    ->getValue($instance);
}