diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index c560e25..0db2274 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\KernelTests;
 
+use Drupal\Component\FileCache\FileCacheFactory;
 use Drupal\Component\Utility\Html;
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Config\ConfigImporter;
@@ -480,6 +481,32 @@ private function getCompiledContainerBuilder(array $modules) {
   }
 
   /**
+   * Initializes the FileCacheFactory component.
+   *
+   * We can not use the Settings object in a component, that's why we have to do
+   * it here instead of \Drupal\Component\FileCache\FileCacheFactory.
+   */
+  protected function initFileCache() {
+    $configuration = Settings::get('file_cache');
+
+    // Provide a default configuration, if not set.
+    if (!isset($configuration['default'])) {
+      $configuration['default'] = [
+        'class' => '\Drupal\Component\FileCache\FileCache',
+        'cache_backend_class' => NULL,
+        'cache_backend_configuration' => [],
+      ];
+      // @todo Use extension_loaded('apcu') for non-testbot
+      //  https://www.drupal.org/node/2447753.
+      if (function_exists('apc_fetch')) {
+        $configuration['default']['cache_backend_class'] = '\Drupal\Component\FileCache\ApcuFileCacheBackend';
+      }
+    }
+    FileCacheFactory::setConfiguration($configuration);
+    FileCacheFactory::setPrefix(Settings::getApcuPrefix('file_cache', $this->root));
+  }
+
+  /**
    * Returns Extension objects for $modules to enable.
    *
    * @param string[] $modules
@@ -495,6 +522,8 @@ private function getCompiledContainerBuilder(array $modules) {
    * @see \Drupal\Core\Extension\ModuleHandler::add()
    */
   private function getExtensionsForModules(array $modules) {
+    $this->initFileCache();
+
     $extensions = array();
     $discovery = new ExtensionDiscovery($this->root);
     $discovery->setProfileDirectories(array());
