From 89c036717f583242bef91c90171627fe3c3de1bc Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 17 Sep 2011 14:10:53 -0400 Subject: - Patch #952772 by oriol_e9g, mdupont, bleen18, idflood: theme_html_tag() optional value not really optional. --- modules/simpletest/tests/theme.test | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'modules/simpletest') diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test index f1e1bd58b..53557e361 100644 --- a/modules/simpletest/tests/theme.test +++ b/modules/simpletest/tests/theme.test @@ -354,3 +354,29 @@ class ThemeFastTestCase extends DrupalWebTestCase { $this->assertText('registry not initialized', t('The registry was not initialized')); } } + +/** + * Unit tests for theme_html_tag(). + */ +class ThemeHtmlTag extends DrupalUnitTestCase { + public static function getInfo() { + return array( + 'name' => '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), t('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), t('Test title tag generation.')); + } +} -- cgit v1.2.3