diff a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutocompleteTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutocompleteTest.php (rejected hunks)
@@ -90,31 +90,31 @@ function testTermAutocompletion() {
// We should get both terms in a JSON encoded string.
$input = '10/';
$data = $this->drupalGetAJAX($path_prefix_single, array('query' => array('q' => $input)));
- $this->assertEqual(strip_tags($data[$first_term->name. ' (1)']), check_plain($first_term->name), 'Autocomplete returned the first matching term');
- $this->assertEqual(strip_tags($data[$second_term->name. ' (2)']), check_plain($second_term->name), 'Autocomplete returned the second matching term');
+ $this->assertEqual(strip_tags($data[$first_term->label(). ' (1)']), check_plain($first_term->label()), 'Autocomplete returned the first matching term');
+ $this->assertEqual(strip_tags($data[$second_term->label(). ' (2)']), check_plain($second_term->label()), 'Autocomplete returned the second matching term');
// Try to autocomplete a term name that matches the first term.
// We should only get the first term in a JSON encoded string.
$input = '10/16';
$this->drupalGet($path_prefix_single, array('query' => array('q' => $input)));
- $target = array($first_term->name . ' (1)' => '
' . check_plain($first_term->name) . '
');
+ $target = array($first_term->label() . ' (1)' => '' . check_plain($first_term->label()) . '
');
$this->assertRaw(drupal_json_encode($target), 'Autocomplete returns only the expected matching term.');
// Try to autocomplete a term name that matches the second term, and the
// first term is already typed in the autocomplete (tags) widget.
- $input = $first_term->name . ' (1), 10/17';
+ $input = $first_term->label() . ' (1), 10/17';
$data = $this->drupalGetAJAX($path_prefix_tags, array('query' => array('q' => $input)));
- $this->assertEqual(strip_tags($data[$first_term->name . ' (1), ' . $second_term->name . ' (2)']), check_plain($second_term->name), 'Autocomplete returned the second matching term');
+ $this->assertEqual(strip_tags($data[$first_term->label() . ' (1), ' . $second_term->label() . ' (2)']), check_plain($second_term->label()), 'Autocomplete returned the second matching term');
// Try to autocomplete a term name with both a comma and a slash.
$input = '"term with, comma and / a';
$this->drupalGet($path_prefix_single, array('query' => array('q' => $input)));
$n = $third_term->name;
// Term names containing commas or quotes must be wrapped in quotes.
- if (strpos($third_term->name, ',') !== FALSE || strpos($third_term->name, '"') !== FALSE) {
- $n = '"' . str_replace('"', '""', $third_term->name) . ' (3)"';
+ if (strpos($third_term->label(), ',') !== FALSE || strpos($third_term->label(), '"') !== FALSE) {
+ $n = '"' . str_replace('"', '""', $third_term->label()) . ' (3)"';
}
- $target = array($n => '' . check_plain($third_term->name) . '
');
+ $target = array($n => '' . check_plain($third_term->label()) . '
');
$this->assertRaw(drupal_json_encode($target), 'Autocomplete returns a term containing a comma and a slash.');
}
}