function FieldUiRouteEnhancerTest::testFieldUiRouteEnhancerDeprecation

Tests deprecation of the "field_ui.route_enhancer" service.

File

core/modules/field_ui/tests/src/Kernel/FieldUiRouteEnhancerTest.php, line 25

Class

FieldUiRouteEnhancerTest
Tests that the service "field_ui.route_enhancer" has been deprecated.

Namespace

Drupal\Tests\field_ui\Kernel

Code

public function testFieldUiRouteEnhancerDeprecation() {
    $this->expectDeprecation('The "field_ui.route_enhancer" service is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use the "route_enhancer.entity_bundle" service instead. See https://www.drupal.org/node/3245017');
    $legacy_service = \Drupal::service('field_ui.route_enhancer');
    $new_service = \Drupal::service('route_enhancer.entity_bundle');
    $this->assertSame($new_service, $legacy_service);
}

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