function DeprecatedServicesTest::assertSharedProperty

Asserts that a shared property has the expected value.

Parameters

mixed $expected: The property expected value.

\Drupal\Core\Path\AliasManager $legacy_alias_manager: An instance of the legacy alias manager.

string $property: The property name.

1 call to DeprecatedServicesTest::assertSharedProperty()
DeprecatedServicesTest::testAliasManagerSharedState in core/modules/path_alias/tests/src/Kernel/DeprecatedServicesTest.php
Test that the new alias manager and the legacy ones share the same state.

File

core/modules/path_alias/tests/src/Kernel/DeprecatedServicesTest.php, line 152

Class

DeprecatedServicesTest
Tests deprecation of path alias core services and the related BC logic.

Namespace

Drupal\Tests\path_alias\Kernel

Code

protected function assertSharedProperty($expected, CoreAliasManager $legacy_alias_manager, $property) {
    $reflector = new \ReflectionProperty(get_class($legacy_alias_manager), $property);
    $reflector->setAccessible(TRUE);
    $this->assertSame($expected, $reflector->getValue($legacy_alias_manager));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.