$links=$this->xpath('head/link[@rel = "alternate" and @href = :href and @hreflang = :hreflang]',$args);
$message=sprintf('The "%s" translation has the correct alternate hreflang link for "%s": %s.',$langcode,$langcode_alternate,$url->toString());
$this->assertTrue(isset($links[0]),$message);
$this->assertSession()->elementAttributeContains('xpath',"head/link[@rel='alternate' and @hreflang='$langcode_alternate']",'href',$url_alternate->toString());
}
}
@@ -135,12 +132,7 @@ function ($langcode) use ($url_base, $languageManager) {
'absolute'=>TRUE,
'language'=>$language,
])->toString();
$args=[
':href'=>$frontpage_path,
':hreflang'=>$language->getId(),
];
$links=$this->xpath('head/link[@rel = "alternate" and @href = :href and @hreflang = :hreflang]',$args);
$this->assertArrayHasKey(0,$links);
$this->assertSession()->elementAttributeContains('xpath',"head/link[@rel='alternate' and @hreflang='{$language->getId()}']",'href',$frontpage_path);
@@ -362,8 +361,7 @@ public function testFieldFormUnlimitedRequired() {
// Display creation form -> 1 widget.
$this->drupalGet('entity_test/add');
// Check that the Required symbol is present for the multifield label.
$element=$this->xpath('//h4[contains(@class, "label") and contains(@class, "js-form-required") and contains(text(), :value)]',[':value'=>$this->field['label']]);
$this->assertTrue(isset($element[0]),'Required symbol added field label.');
$this->assertSession()->elementAttributeContains('xpath',"//h4[contains(@class, 'label') and contains(text(), '{$this->field['label']}')]",'class','js-form-required');
// Check that the label of the field input is visually hidden and contains
// the field title and an indication of the delta for a11y.
$this->assertSession()->elementExists('xpath',"//label[@for='edit-field-unlimited-0-value' and contains(@class, 'visually-hidden') and contains(text(), '{$this->field['label']} (value 1)')]");