diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/HtmlTagUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/HtmlTagUnitTest.php deleted file mode 100644 index b8c6ffb..0000000 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/HtmlTagUnitTest.php +++ /dev/null @@ -1,36 +0,0 @@ - 'Theme HTML Tag', - 'description' => 'Tests theme_html_tag() built-in theme functions.', - 'group' => 'Theme', - ); - } - - /** - * Test function theme_html_tag() - */ - function testThemeHtmlTag() { - // Test auto-closure meta tag generation - $tag['element'] = array('#tag' => 'meta', '#attributes' => array('name' => 'description', 'content' => 'Drupal test')); - $this->assertEqual(''."\n", theme_html_tag($tag), 'Test auto-closure meta tag generation.'); - - // Test title tag generation - $tag['element'] = array('#tag' => 'title', '#value' => 'title test'); - $this->assertEqual('title test'."\n", theme_html_tag($tag), 'Test title tag generation.'); - } -} diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/PreprocessHtmlTagUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/PreprocessHtmlTagUnitTest.php new file mode 100644 index 0000000..e5c18cb --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/PreprocessHtmlTagUnitTest.php @@ -0,0 +1,41 @@ + 'Preprocess HTML Tag', + 'description' => 'Tests template_preprocess_html_tag() function.', + 'group' => 'Theme', + ); + } + + /** + * Tests template_preprocess_html_tag(). + */ + function testPreprocessHtmlTag() { + // Test running sample meta tag through the preprocess function. + $variables['element'] = array('#tag' => 'meta', '#attributes' => array('name' => 'description', 'content' => 'Drupal test')); + template_preprocess_html_tag($variables); + $this->assertEqual($variables['tag'], 'meta', "'tag' variable is set to 'meta'."); + $this->assertTrue(!isset($variables['value']), "'value' variable is not set when no value is passed in."); + + // Test running sample title tag through the preprocess function. + $variables = array(); + $variables['element'] = array('#tag' => 'title', '#value' => 'title test'); + template_preprocess_html_tag($variables); + $this->assertEqual($variables['tag'], 'title', "'tag' variable is set to 'title'."); + $this->assertEqual($variables['value'], 'title test', "'value' variable is equal to the value of '#value' in the element array."); + } +} diff --git a/core/modules/system/templates/html-tag.html.twig b/core/modules/system/templates/html-tag.html.twig index 74921e4..4118f3b 100644 --- a/core/modules/system/templates/html-tag.html.twig +++ b/core/modules/system/templates/html-tag.html.twig @@ -19,7 +19,7 @@ * * @ingroup themeable */ - @todo: delete this file once http://drupal.org/node/1825090 is resolved. + @todo Delete this file once http://drupal.org/node/1825090 is resolved. #} {% if value is defined -%} <{{ tag }}{{ attributes }}>