function EntityConverterTest::testDeprecatedLanguageManagerProperty
Tests that retrieving the language manager triggers a deprecation error.
@group legacy
@expectedDeprecation The property languageManager (language_manager service) is deprecated in Drupal\Core\ParamConverter\EntityConverter and will be removed before Drupal 9.0.0.
File
-
core/
tests/ Drupal/ Tests/ Core/ ParamConverter/ EntityConverterTest.php, line 194
Class
- EntityConverterTest
- @coversDefaultClass \Drupal\Core\ParamConverter\EntityConverter @group ParamConverter @group Entity
Namespace
Drupal\Tests\Core\ParamConverterCode
public function testDeprecatedLanguageManagerProperty() {
$this->setUpMocks([
'language_manager' => $this->createMock(LanguageManagerInterface::class),
]);
$this->entityConverter = new EntityConverter($this->entityTypeManager, $this->entityRepository);
$this->assertSame(\Drupal::service('language_manager'), $this->entityConverter
->__get('languageManager'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.