diff -u b/core/modules/system/src/Tests/Theme/FunctionsTest.php b/core/modules/system/src/Tests/Theme/FunctionsTest.php --- b/core/modules/system/src/Tests/Theme/FunctionsTest.php +++ b/core/modules/system/src/Tests/Theme/FunctionsTest.php @@ -42,6 +42,19 @@ $expected = ''; $this->assertThemeOutput('item_list', $variables, $expected, 'Empty %callback with title generates no output.'); + // Verify that empty items produce the empty string. + $variables = array(); + $variables['empty'] = 'No items found.'; + $expected = '
No items found.
'; + $this->assertThemeOutput('item_list', $variables, $expected, 'Empty %callback generates empty string.'); + + // Verify that empty items produce the empty string with title. + $variables = array(); + $variables['title'] = 'Some title'; + $variables['empty'] = 'No items found.'; + $expected = '

Some title

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