You are here

protected function DeprecatedServicesTest::setServiceClass in Drupal 8

Sets the specified implementation for the service being tested.

Parameters

string $class: The name of the implementation class.

bool $use_decorator: (optional) Whether using a decorator service to wrap the specified class. Defaults to no decorator.

Return value

string The specified class name.

4 calls to DeprecatedServicesTest::setServiceClass()
DeprecatedServicesTest::testDecoratorForNewServiceImplementation in core/modules/path_alias/tests/src/Kernel/DeprecatedServicesTest.php
@expectedDeprecation The "path_alias_deprecated_test.path.alias_manager.inner" service is deprecated. Use "path_alias.manager" instead. See https://drupal.org/node/3092086
DeprecatedServicesTest::testDecoratorForOverriddenServiceImplementation in core/modules/path_alias/tests/src/Kernel/DeprecatedServicesTest.php
@expectedDeprecation The "path_alias_deprecated_test.path.alias_manager.inner" service is deprecated. Use "path_alias.manager" instead. See https://drupal.org/node/3092086 @expectedDeprecation The \Drupal\Core\Path\AliasManager…
DeprecatedServicesTest::testNewServiceImplementation in core/modules/path_alias/tests/src/Kernel/DeprecatedServicesTest.php
@expectedDeprecation The "path.alias_manager" service is deprecated. Use "path_alias.manager" instead. See https://drupal.org/node/3092086
DeprecatedServicesTest::testOverriddenServiceImplementation in core/modules/path_alias/tests/src/Kernel/DeprecatedServicesTest.php
@expectedDeprecation The "path.alias_manager" service is deprecated. Use "path_alias.manager" instead. See https://drupal.org/node/3092086 @expectedDeprecation The \Drupal\Core\Path\AliasManager class is deprecated in drupal:8.8.0…

File

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

Class

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

Namespace

Drupal\Tests\path_alias\Kernel

Code

protected function setServiceClass($class, $use_decorator = FALSE) {
  PathAliasDeprecatedTestServiceProvider::$newClass = $class;
  PathAliasDeprecatedTestServiceProvider::$useDecorator = $use_decorator;
  $this->container
    ->get('kernel')
    ->rebuildContainer();
  return $class;
}