From cb009a324e86e1bd4ab4d421881ab96f9077906a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 18 Mar 2010 19:03:29 +0000 Subject: - Patch #720202 by naxoc, kkaefer: theme_table() doesn't use thead with empty cells. --- modules/simpletest/tests/theme.test | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'modules/simpletest') diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test index c46dc9d93..d3ba6f9bb 100644 --- a/modules/simpletest/tests/theme.test +++ b/modules/simpletest/tests/theme.test @@ -95,6 +95,17 @@ class ThemeTableUnitTest extends DrupalWebTestCase { $this->assertNoRaw('sticky-enabled', t('Table does not have a class of sticky-enabled because $sticky = FALSE.')); drupal_static_reset('drupal_add_js'); } + + /** + * Tests that the table header is printed even if there are no rows. And that + * the empty text is displayed correctly. + */ + function testThemeTableWithEmptyMessage() { + $header = array(t('Header 1'), t('Header 2')); + $this->content = theme('table', array('header' => $header, 'rows' => array(), 'empty' => t('No strings available.'))); + $this->assertRaw('No strings available.', t('Correct colspan was set on empty message.')); + $this->assertRaw('Header 1', t('Table header was printed.')); + } } /** -- cgit v1.2.3