diff --git a/core/lib/Drupal/Core/Theme/ThemeManager.php b/core/lib/Drupal/Core/Theme/ThemeManager.php index 6850fcb..1a673b8 100644 --- a/core/lib/Drupal/Core/Theme/ThemeManager.php +++ b/core/lib/Drupal/Core/Theme/ThemeManager.php @@ -168,7 +168,7 @@ protected function theme($hook, $variables = array()) { $original_hook = $hook; // If there's no implementation, check for more generic fallbacks. - // If there's still no implementation, log an error and return an empty + // If there's still no implementation, trigger an error and return an empty // string. if (!$theme_registry->has($hook)) { // Iteratively strip everything after the last '__' delimiter, until an @@ -180,10 +180,10 @@ protected function theme($hook, $variables = array()) { } } if (!$theme_registry->has($hook)) { - // Only log a message when not trying theme suggestions ($hook being an - // array). + // Only trigger an error when not trying theme suggestions ($hook being + // an array). if (!isset($candidate)) { - \Drupal::logger('theme')->warning('Theme hook %hook not found.', array('%hook' => $hook)); + trigger_error(sprintf("Unknown theme hook '%s'.", $original_hook), E_USER_ERROR); } // There is no theme implementation for the hook passed. Return FALSE so // the function calling _theme() can differentiate between a hook that @@ -317,6 +317,9 @@ protected function theme($hook, $variables = array()) { if (function_exists($info['function'])) { $output = SafeMarkup::set($info['function']($variables)); } + else { + trigger_error(sprintf("Missing theme function '%s' for theme hook '%s'.", $info['function'], $hook), E_USER_ERROR); + } } else { $render_function = 'twig_render_template'; diff --git a/core/modules/aggregator/src/Tests/AggregatorTitleTest.php b/core/modules/aggregator/src/Tests/AggregatorTitleTest.php index cfa9975..2474ba7 100644 --- a/core/modules/aggregator/src/Tests/AggregatorTitleTest.php +++ b/core/modules/aggregator/src/Tests/AggregatorTitleTest.php @@ -24,7 +24,7 @@ class AggregatorTitleTest extends KernelTestBase { * * @var array */ - public static $modules = array('file', 'field', 'options', 'aggregator', 'entity_reference'); + public static $modules = ['file', 'field', 'options', 'aggregator', 'entity_reference', 'system']; /** * The field name that is tested. @@ -74,7 +74,7 @@ public function testStringFormatter() { $build = $aggregator_feed->{$this->fieldName}->view(['type' => 'aggregator_title', 'settings' => ['display_as_link' => FALSE]]); $result = $this->render($build); - $this->assertTrue(strpos($result, 'testing title') === 0); + $this->assertTrue(preg_match('/testing title/', $result)); $this->assertTrue(strpos($result, $aggregator_feed->getUrl()) === FALSE); // Verify aggregator item title with and without links. @@ -85,8 +85,8 @@ public function testStringFormatter() { $this->assertTrue(strpos($result, 'href="' . $aggregator_item->getLink()) . '"'); $build = $aggregator_item->{$this->fieldName}->view(['type' => 'aggregator_title', 'settings' => ['display_as_link' => FALSE]]); - $result = $this->render($build); - $this->assertTrue(strpos($result, 'test title') === 0); + $result = strip_tags($this->render($build)); + $this->assertTrue(preg_match('/test title/', $result)); $this->assertTrue(strpos($result, $aggregator_item->getLink()) === FALSE); } diff --git a/core/modules/field/src/Tests/Boolean/BooleanFormatterTest.php b/core/modules/field/src/Tests/Boolean/BooleanFormatterTest.php index 214590d..a2ff305 100644 --- a/core/modules/field/src/Tests/Boolean/BooleanFormatterTest.php +++ b/core/modules/field/src/Tests/Boolean/BooleanFormatterTest.php @@ -27,7 +27,7 @@ class BooleanFormatterTest extends KernelTestBase { * * @var array */ - public static $modules = ['field', 'text', 'entity_test', 'user']; + public static $modules = ['field', 'text', 'entity_test', 'user', 'system']; /** * @var string diff --git a/core/modules/node/src/Tests/NodeListBuilderTest.php b/core/modules/node/src/Tests/NodeListBuilderTest.php index 798a056..1381cb4 100644 --- a/core/modules/node/src/Tests/NodeListBuilderTest.php +++ b/core/modules/node/src/Tests/NodeListBuilderTest.php @@ -20,7 +20,7 @@ class NodeListBuilderTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['node', 'user']; + public static $modules = ['node', 'user', 'system']; protected function setUp() { parent::setUp(); diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php index 0b365cb..13ab739 100644 --- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php +++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php @@ -380,6 +380,7 @@ public function testReferencedEntity() { ); $this->pass("Test referencing entity.", 'Debug'); + debug($referencing_entity_url); $this->verifyPageCache($referencing_entity_url, 'MISS'); // Verify a cache hit, but also the presence of the correct cache tags. $this->verifyPageCache($referencing_entity_url, 'HIT', Cache::mergeTags($referencing_entity_cache_tags, $page_cache_tags, $page_cache_tags_referencing_entity));