Issue #1164682 by mgifford, thedavidmeister, good_man, mvc, clemens.tolboom,...
Issue #1164682 by mgifford, thedavidmeister, good_man, mvc, clemens.tolboom, sxnc, lazysoundsystem: Fixed links with a known language need language identifier.
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
$this->assertTrue($this->hasAttribute('hreflang',$rendered,$langcode),format_string('hreflang attribute with value @langcode is present on a rendered link when langcode is provided in the render array.',array('@langcode'=>$langcode)));
$rendered=drupal_render($hreflang_override_link);
$this->assertTrue($this->hasAttribute('hreflang',$rendered,'foo'),format_string('hreflang attribute with value @hreflang is present on a rendered link when @hreflang is provided in the render array.',array('@hreflang'=>'foo')));
// Test the active class in links produced by l() and #type 'link'.
$options_no_query=array();
$options_query=array(
'query'=>array(
...
...
@@ -88,16 +113,12 @@ function testLinkActiveClass() {
$links=$this->xpath('//a[@href = :href and not(contains(@class, :class))]',array(':href'=>url($path,$options_no_query),':class'=>'active'));
$this->assertTrue(isset($links[0]),'A link generated by l() to the current page without a query string when the current page has a query string is not marked active.');
}
/**
* Tests for custom class in links produced by l() and #type 'link'.
*/
functiontestLinkCustomClass(){
// Test adding a custom class in links produced by l() and #type 'link'.
$this->assertTrue($this->hasClass($link_l,$class_l),format_string('Custom class @class is present on link when requested by l()',array('@class'=>$class_l)));
$this->assertTrue($this->hasAttribute('class',$link_l,$class_l),format_string('Custom class @class is present on link when requested by l()',array('@class'=>$class_l)));
// Test #type.
$class_theme=$this->randomName();
...
...
@@ -112,7 +133,7 @@ function testLinkCustomClass() {
),
);
$link_theme=drupal_render($type_link);
$this->assertTrue($this->hasClass($link_theme,$class_theme),format_string('Custom class @class is present on link when requested by #type',array('@class'=>$class_theme)));
$this->assertTrue($this->hasAttribute('class',$link_theme,$class_theme),format_string('Custom class @class is present on link when requested by #type',array('@class'=>$class_theme)));
}
/**
...
...
@@ -157,8 +178,8 @@ function testLinkRenderArrayText() {