diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php index 2be4bb294e..d2254e48e3 100644 --- a/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php +++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php @@ -332,8 +332,11 @@ public function testFieldAdminHandler() { $this->drupalPostForm(NULL, $edit, t('Save field settings')); $this->drupalGet($bundle_path . '/fields/' . $field_path); $term_name = $this->randomString(); - $terms = taxonomy_term_load_multiple_by_name($term_name, 'tags'); - $this->assertIdentical(0, count($terms), "No taxonomy terms exist with the name '$term_name'."); + $entity_query = $this->container->get('entity_type.manager')->getStorage('taxonomy_term')->getQuery(); + $entity_query->condition('name', $term_name); + $entity_query->condition('vid', 'tags'); + $result = $entity_query->execute(); + $this->assertIdentical(0, count($result), "No taxonomy terms exist with the name '$term_name'."); $edit = [ // This must be set before new entities will be auto-created. 'settings[handler_settings][auto_create]' => 1, @@ -346,8 +349,11 @@ public function testFieldAdminHandler() { ]; $this->drupalPostForm(NULL, $edit, t('Save settings')); // The term should now exist. - $terms = taxonomy_term_load_multiple_by_name($term_name, 'tags'); - $this->assertIdentical(1, count($terms), 'Taxonomy term was auto created when set as field default.'); + $entity_query = $this->container->get('entity_type.manager')->getStorage('taxonomy_term')->getQuery(); + $entity_query->condition('name', $term_name); + $entity_query->condition('vid', 'tags'); + $result = $entity_query->execute(); + $this->assertIdentical(1, count($result), 'Taxonomy term was auto created when set as field default.'); } /**