diff --git a/core/lib/Drupal/Core/Theme/ThemeManager.php b/core/lib/Drupal/Core/Theme/ThemeManager.php
index d4c6a2c..133e546 100644
--- a/core/lib/Drupal/Core/Theme/ThemeManager.php
+++ b/core/lib/Drupal/Core/Theme/ThemeManager.php
@@ -162,7 +162,7 @@ public function render($hook, array $variables) {
     $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
@@ -174,10 +174,10 @@ public function render($hook, array $variables) {
         }
       }
       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
@@ -322,6 +322,9 @@ public function render($hook, array $variables) {
         // has been written correctly and that the markup is safe.
         $output = Markup::create($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 d599d9a..da4d79d 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 = ['file', 'field', 'options', 'aggregator'];
+  public static $modules = ['file', 'field', 'options', 'aggregator', '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 2d23604..e4a0d35 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/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index 10463d9..e9843b6 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -597,7 +597,7 @@ protected function render(array &$elements) {
     // Use the bare HTML page renderer to render our links.
     $renderer = $this->container->get('bare_html_page_renderer');
     $response = $renderer->renderBarePage(
-      $elements, '', $this->container->get('theme.manager')->getActiveTheme()->getName()
+      $elements, '', 'page'
     );
 
     // Glean the content from the response object.
diff --git a/core/modules/system/src/Tests/Common/AddFeedTest.php b/core/modules/system/src/Tests/Common/AddFeedTest.php
index 0620051..62c30db 100644
--- a/core/modules/system/src/Tests/Common/AddFeedTest.php
+++ b/core/modules/system/src/Tests/Common/AddFeedTest.php
@@ -64,7 +64,7 @@ function testBasicFeedAddNoTitle() {
     // Use the bare HTML page renderer to render our links.
     $renderer = $this->container->get('bare_html_page_renderer');
     $response = $renderer->renderBarePage(
-      $build, '', $this->container->get('theme.manager')->getActiveTheme()->getName()
+      $build, '', 'page'
     );
     // Glean the content from the response object.
     $this->setRawContent($response->getContent());
diff --git a/core/modules/system/src/Tests/Common/RenderTest.php b/core/modules/system/src/Tests/Common/RenderTest.php
index 98de2b5..02aca6e 100644
--- a/core/modules/system/src/Tests/Common/RenderTest.php
+++ b/core/modules/system/src/Tests/Common/RenderTest.php
@@ -58,7 +58,7 @@ public function testProcessAttached() {
     $build['#attached']['drupal_process_states'][] = [];
     $renderer = $this->container->get('bare_html_page_renderer');
     try {
-      $renderer->renderBarePage($build, '', $this->container->get('theme.manager')->getActiveTheme()->getName());
+      $renderer->renderBarePage($build, '', 'page');
       $this->fail("Invalid #attachment 'drupal_process_states' allowed");
     }
     catch (\LogicException $e) {
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index f1a1414..6579393 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -913,7 +913,7 @@ protected function render(array &$elements) {
     // Use the bare HTML page renderer to render our links.
     $renderer = $this->container->get('bare_html_page_renderer');
     $response = $renderer->renderBarePage(
-      $elements, '', $this->container->get('theme.manager')->getActiveTheme()->getName()
+      $elements, '', 'page'
     );
 
     // Glean the content from the response object.
