diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index 6cfbda5ae0..a40ecdc8a3 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -25,6 +25,10 @@
 use PHPUnit\Framework\TestCase;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\VarDumper\VarDumper;
+use Symfony\Component\VarDumper\Cloner\VarCloner;
+use Symfony\Component\VarDumper\Dumper\CliDumper;
+use Symfony\Component\VarDumper\Dumper\HtmlDumper;
 use org\bovigo\vfs\vfsStream;
 use org\bovigo\vfs\visitor\vfsStreamPrintVisitor;
 
@@ -219,6 +223,24 @@
   public static function setUpBeforeClass() {
     parent::setUpBeforeClass();
 
+    // Set up the symfony var dumper so dump() statements within kernel tests
+    // are output to the terminal without causing PHPUnit to complain.
+    VarDumper::setHandler(function ($var) {
+        $cloner = new VarCloner();
+
+        // Need to write a newline before any output.
+        fwrite(STDOUT, "\n");
+
+        $dumper = new CliDumper(function($line) {
+          if ($depth != -1) {
+            fwrite(STDOUT, str_repeat($indent_pad, $depth) . $line . "\n");
+          }
+        });
+
+        $dumper->setColors(TRUE);
+        $dumper->dump($cloner->cloneVar($var));
+    });
+
     // Change the current dir to DRUPAL_ROOT.
     chdir(static::getDrupalRoot());
   }
