- $term = taxonomy_term_load_multiple_by_name($term_name, 'tags')[1];
- $this->assertIdentical(1, count($term), 'Taxonomy term was auto created when set as field default.');
+ $result = \Drupal::entityQuery('taxonomy_term')
+ ->condition('name', $term_name)
+ ->condition('vid', 'tags')
+ ->accessCheck(FALSE)
+ ->execute();
+ $this->assertIdentical(1, count($result), 'Taxonomy term was auto created when set as field default.');