You are here

protected function ViewExecutableTest::getProtectedProperty in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/ViewExecutableTest.php \Drupal\views\Tests\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 core/modules/views/src/Tests/ViewExecutableTest.php
Asserts that expected view properties have been unset by destroy().

File

core/modules/views/src/Tests/ViewExecutableTest.php, line 372
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);
}