$this->assertTrue(isset($class[0]),t('The path-admin class same as on default language.'));
$this->assertTrue(isset($class[0]),'The path-admin class same as on default language.');
// The testing profile sets the user/login page as the frontpage. That
// redirects authenticated users to their profile page, so check with an
@@ -316,17 +316,17 @@ protected function doTestLanguageLinkActiveClassAuthenticated() {
// Language code 'none' link should be active.
$langcode='none';
$links=$this->xpath('//a[@id = :id and @data-drupal-link-system-path = :path]',[':id'=>'no_lang_link',':path'=>$path]);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode has the correct attributes that will allow the drupal.active-link library to mark it as active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode has the correct attributes that will allow the drupal.active-link library to mark it as active.');
// Language code 'en' link should be active.
$langcode='en';
$links=$this->xpath('//a[@id = :id and @hreflang = :lang and @data-drupal-link-system-path = :path]',[':id'=>'en_link',':lang'=>'en',':path'=>$path]);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode has the correct attributes that will allow the drupal.active-link library to mark it as active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode has the correct attributes that will allow the drupal.active-link library to mark it as active.');
// Language code 'fr' link should not be active.
$langcode='fr';
$links=$this->xpath('//a[@id = :id and @hreflang = :lang and @data-drupal-link-system-path = :path]',[':id'=>'fr_link',':lang'=>'fr',':path'=>$path]);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode has the correct attributes that will allow the drupal.active-link library to NOT mark it as active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode has the correct attributes that will allow the drupal.active-link library to NOT mark it as active.');
// Verify that drupalSettings contains the correct values.
$settings=$this->getDrupalSettings();
@@ -341,17 +341,17 @@ protected function doTestLanguageLinkActiveClassAuthenticated() {
// Language code 'none' link should be active.
$langcode='none';
$links=$this->xpath('//a[@id = :id and @data-drupal-link-system-path = :path]',[':id'=>'no_lang_link',':path'=>$path]);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode has the correct attributes that will allow the drupal.active-link library to mark it as active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode has the correct attributes that will allow the drupal.active-link library to mark it as active.');
// Language code 'en' link should not be active.
$langcode='en';
$links=$this->xpath('//a[@id = :id and @hreflang = :lang and @data-drupal-link-system-path = :path]',[':id'=>'en_link',':lang'=>'en',':path'=>$path]);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode has the correct attributes that will allow the drupal.active-link library to NOT mark it as active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode has the correct attributes that will allow the drupal.active-link library to NOT mark it as active.');
// Language code 'fr' link should be active.
$langcode='fr';
$links=$this->xpath('//a[@id = :id and @hreflang = :lang and @data-drupal-link-system-path = :path]',[':id'=>'fr_link',':lang'=>'fr',':path'=>$path]);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode has the correct attributes that will allow the drupal.active-link library to mark it as active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode has the correct attributes that will allow the drupal.active-link library to mark it as active.');
// Verify that drupalSettings contains the correct values.
$settings=$this->getDrupalSettings();
@@ -377,17 +377,17 @@ protected function doTestLanguageLinkActiveClassAnonymous() {
// Language code 'none' link should be active.
$langcode='none';
$links=$this->xpath('//a[@id = :id and contains(@class, :class)]',[':id'=>'no_lang_link',':class'=>'is-active']);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode is marked active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode is marked active.');
// Language code 'en' link should be active.
$langcode='en';
$links=$this->xpath('//a[@id = :id and contains(@class, :class)]',[':id'=>'en_link',':class'=>'is-active']);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode is marked active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode is marked active.');
// Language code 'fr' link should not be active.
$langcode='fr';
$links=$this->xpath('//a[@id = :id and not(contains(@class, :class))]',[':id'=>'fr_link',':class'=>'is-active']);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode is NOT marked active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode is NOT marked active.');
// Test links generated by the link generator on a French page.
$current_language='French';
@@ -396,17 +396,17 @@ protected function doTestLanguageLinkActiveClassAnonymous() {
// Language code 'none' link should be active.
$langcode='none';
$links=$this->xpath('//a[@id = :id and contains(@class, :class)]',[':id'=>'no_lang_link',':class'=>'is-active']);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode is marked active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode is marked active.');
// Language code 'en' link should not be active.
$langcode='en';
$links=$this->xpath('//a[@id = :id and not(contains(@class, :class))]',[':id'=>'en_link',':class'=>'is-active']);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode is NOT marked active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode is NOT marked active.');
// Language code 'fr' link should be active.
$langcode='fr';
$links=$this->xpath('//a[@id = :id and contains(@class, :class)]',[':id'=>'fr_link',':class'=>'is-active']);
$this->assertTrue(isset($links[0]),t('A link generated by :function to the current :language page with langcode :langcode is marked active.',[':function'=>$function_name,':language'=>$current_language,':langcode'=>$langcode]));
$this->assertTrue(isset($links[0]),'A link generated by $function_name to the current $current_language page with langcode $langcode is marked active.');
$elements=$this->xpath('//input[@id="'.$field_id.'" and @aria-describedby="'.$description_id.'"]/following-sibling::div[contains(@class, "visually-hidden")]');
$this->assertTrue(isset($elements[0]),t('Properly renders the #description element visually-hidden.'));
$this->assertTrue(isset($elements[0]),'Properly renders the #description element visually-hidden.');