diff --git a/core/modules/system/tests/modules/theme_test/theme_test.module b/core/modules/system/tests/modules/theme_test/theme_test.module
index 25b6ca8..5bfd7eb 100644
--- a/core/modules/system/tests/modules/theme_test/theme_test.module
+++ b/core/modules/system/tests/modules/theme_test/theme_test.module
@@ -6,6 +6,9 @@
  * Implements hook_theme().
  */
 function theme_test_theme($existing, $type, $theme, $path) {
+  if (Drupal::state()->get('theme_test_theme_null')) {
+    return NULL;
+  }
   $items['theme_test'] = array(
     'file' => 'theme_test.inc',
     'variables' => array('foo' => ''),
