diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Field/Widget/MachineNameWidgetTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Field/Widget/MachineNameWidgetTest.php index 117f0da4aa..045fca4706 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/Core/Field/Widget/MachineNameWidgetTest.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Field/Widget/MachineNameWidgetTest.php @@ -36,7 +36,8 @@ public function testMachineNameWidget() { // First, make sure that both the ID and the label fields are initially // hidden in the form display. - entity_get_form_display('entity_test_string_id', 'entity_test_string_id', 'default') + \Drupal::service('entity_display.repository') + ->getFormDisplay('entity_test_string_id', 'entity_test_string_id', 'default') ->removeComponent('id') ->removeComponent('name') ->save(); @@ -49,7 +50,8 @@ public function testMachineNameWidget() { // Configure the test field to use the machine name widget with no initial // settings. - entity_get_form_display('entity_test_string_id', 'entity_test_string_id', 'default') + \Drupal::service('entity_display.repository') + ->getFormDisplay('entity_test_string_id', 'entity_test_string_id', 'default') ->setComponent('id', [ 'type' => 'machine_name', 'weight' => 5, @@ -80,7 +82,8 @@ public function testMachineNameWidget() { // Enable the 'source' field in the entity form display and configure the // test field to use it. - entity_get_form_display('entity_test_string_id', 'entity_test_string_id', 'default') + \Drupal::service('entity_display.repository') + ->getFormDisplay('entity_test_string_id', 'entity_test_string_id', 'default') ->setComponent('name', [ 'type' => 'string_textfield', 'weight' => 10, @@ -121,7 +124,8 @@ public function testMachineNameWidget() { // Configure the source field to have a lower weight than the test field, // which will finally make it appear in the entity form. - entity_get_form_display('entity_test_string_id', 'entity_test_string_id', 'default') + \Drupal::service('entity_display.repository') + ->getFormDisplay('entity_test_string_id', 'entity_test_string_id', 'default') ->setComponent('name', [ 'type' => 'string_textfield', 'weight' => 4, @@ -158,7 +162,8 @@ public function testMachineNameWidget() { $this->assertSame($test_values['expected'], $entity->id->value); // Try changing the 'replace_pattern' and 'replace' settings of the widget. - entity_get_form_display('entity_test_string_id', 'entity_test_string_id', 'default') + \Drupal::service('entity_display.repository') + ->getFormDisplay('entity_test_string_id', 'entity_test_string_id', 'default') ->setComponent('id', [ 'type' => 'machine_name', 'weight' => 5,