commit 6908e01492b55252e5c6a59be8b9f9714cb3b362 Author: Joel Pittet Date: Sun Aug 10 19:24:02 2014 -0700 test for render array diff --git a/core/modules/system/src/Tests/Theme/FunctionsTest.php b/core/modules/system/src/Tests/Theme/FunctionsTest.php index eda48e2..577e075 100644 --- a/core/modules/system/src/Tests/Theme/FunctionsTest.php +++ b/core/modules/system/src/Tests/Theme/FunctionsTest.php @@ -55,12 +55,22 @@ function testItemList() { $expected = '

Some title

No items found.
'; $this->assertThemeOutput('item_list', $variables, $expected, 'Empty %callback generates empty string with title.'); - // Verify that header set to "0" is output. + // Verify that title set to 0 is output. $variables = array(); $variables['title'] = 0; $variables['empty'] = 'No items found.'; $expected = '

0

No items found.
'; - $this->assertThemeOutput('item_list', $variables, $expected, '%callback with header set to "0" generates a title.'); + $this->assertThemeOutput('item_list', $variables, $expected, '%callback with title set to 0 generates a title.'); + + // Verify that title set to a render array is output. + $variables = array(); + $variables['title'] = array( + '#theme' => 'markup', + '#markup' => 'Render array', + ); + $variables['empty'] = 'No items found.'; + $expected = '

Render array

No items found.
'; + $this->assertThemeOutput('item_list', $variables, $expected, '%callback with title set to a render array generates a title.'); // Verify that empty text is not displayed when there are list items. $variables = array();