diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderElementTypesTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderElementTypesTest.php index 7d41c78..453155f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderElementTypesTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderElementTypesTest.php @@ -10,6 +10,8 @@ use Drupal\Component\Utility\String; use Drupal\Component\Utility\Url; use Drupal\Component\Utility\Xss; +use Drupal\Core\Language\Language; +use Drupal\Core\Template\Attribute; use Drupal\simpletest\WebTestBase; /** @@ -137,6 +139,13 @@ function testHtmlTag() { function testMaintenancePage() { // We need to simulate a lot of what would happen in the preprocess, or // there's no way to make these tests portable. + + // HTML element attributes. + $html_attributes = new Attribute; + $language_interface = \Drupal::languageManager()->getLanguage(Language::TYPE_INTERFACE); + $html_attributes['lang'] = $language_interface->id; + $html_attributes['dir'] = $language_interface->direction ? 'rtl' : 'ltr'; + $site_config = \Drupal::config('system.site'); $site_name = $site_config->get('name'); $site_slogan = $site_config->get('slogan'); @@ -178,7 +187,7 @@ function testMaintenancePage() { // Simulate the expected output of a "vanilla" maintenance page. $expected = << - + !head !head_title @@ -207,6 +216,7 @@ function testMaintenancePage() { EOT; $placeholders = array( + '!html_attributes' => $html_attributes->__toString(), '!head' => drupal_get_html_head(), '!head_title' => $head_title, '!styles' => drupal_get_css($css),