diff --git a/core/modules/system/src/Tests/File/RemoteFileDirectoryTest.php b/core/modules/system/tests/src/Kernel/File/RemoteFileDirectoryTest.php
similarity index 89%
rename from core/modules/system/src/Tests/File/RemoteFileDirectoryTest.php
rename to core/modules/system/tests/src/Kernel/File/RemoteFileDirectoryTest.php
index 12e3267..4033a4b 100644
--- a/core/modules/system/src/Tests/File/RemoteFileDirectoryTest.php
+++ b/core/modules/system/tests/src/Kernel/File/RemoteFileDirectoryTest.php
@@ -5,7 +5,9 @@
  * Contains \Drupal\system\Tests\File\RemoteFileDirectoryTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\Tests\system\Kernel\File;
+
+use Drupal\KernelTests\Core\File\DirectoryTest;
 
 /**
  * Tests operations dealing with directories.
diff --git a/core/modules/system/src/Tests/File/RemoteFileScanDirectoryTest.php b/core/modules/system/tests/src/Kernel/File/RemoteFileScanDirectoryTest.php
similarity index 89%
rename from core/modules/system/src/Tests/File/RemoteFileScanDirectoryTest.php
rename to core/modules/system/tests/src/Kernel/File/RemoteFileScanDirectoryTest.php
index 4f601f8..0388d63 100644
--- a/core/modules/system/src/Tests/File/RemoteFileScanDirectoryTest.php
+++ b/core/modules/system/tests/src/Kernel/File/RemoteFileScanDirectoryTest.php
@@ -5,7 +5,8 @@
  * Contains \Drupal\system\Tests\File\RemoteFileScanDirectoryTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\Tests\system\Kernel\File;
+use Drupal\KernelTests\Core\File\ScanDirectoryTest;
 
 /**
  * Tests the file_scan_directory() function.
diff --git a/core/modules/system/src/Tests/Image/ToolkitGdTest.php b/core/modules/system/tests/src/Kernel/Image/ToolkitGdTest.php
similarity index 98%
rename from core/modules/system/src/Tests/Image/ToolkitGdTest.php
rename to core/modules/system/tests/src/Kernel/Image/ToolkitGdTest.php
index 1c61235..f47d801 100644
--- a/core/modules/system/src/Tests/Image/ToolkitGdTest.php
+++ b/core/modules/system/tests/src/Kernel/Image/ToolkitGdTest.php
@@ -5,11 +5,12 @@
  * Contains \Drupal\system\Tests\Image\ToolkitGdTest.
  */
 
-namespace Drupal\system\Tests\Image;
+namespace Drupal\Tests\system\Kernel\Image;
 
 use Drupal\Core\Image\ImageInterface;
 use Drupal\Component\Utility\SafeMarkup;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\Core\Site\Settings;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests that core image manipulations work properly: scale, resize, rotate,
@@ -253,7 +254,7 @@ function testManipulations() {
     }
 
     // Prepare a directory for test file results.
-    $directory = $this->publicFilesDirectory .'/imagetest';
+    $directory = Settings::get('file_public_path') .'/imagetest';
     file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
 
     foreach ($files as $file) {
@@ -429,7 +430,7 @@ public function testResourceDestruction() {
    */
   function testGifTransparentImages() {
     // Prepare a directory for test file results.
-    $directory = $this->publicFilesDirectory .'/imagetest';
+    $directory = Settings::get('file_public_path') .'/imagetest';
     file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
 
     // Test loading an indexed GIF image with transparent color set.
diff --git a/core/modules/system/src/Tests/System/InfoAlterTest.php b/core/modules/system/tests/src/Kernel/System/InfoAlterTest.php
similarity index 89%
rename from core/modules/system/src/Tests/System/InfoAlterTest.php
rename to core/modules/system/tests/src/Kernel/System/InfoAlterTest.php
index 6e7d231..ffcede5 100644
--- a/core/modules/system/src/Tests/System/InfoAlterTest.php
+++ b/core/modules/system/tests/src/Kernel/System/InfoAlterTest.php
@@ -2,12 +2,12 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\System\InfoAlterTest.
+ * Contains \Drupal\Tests\system\Kernel\System\InfoAlterTest.
  */
 
-namespace Drupal\system\Tests\System;
+namespace Drupal\Tests\system\Kernel\System;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests the effectiveness of hook_system_info_alter().
diff --git a/core/modules/system/src/Tests/Update/DbDumpTest.php b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
similarity index 97%
rename from core/modules/system/src/Tests/Update/DbDumpTest.php
rename to core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
index 230743d..ce49171 100644
--- a/core/modules/system/src/Tests/Update/DbDumpTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
@@ -2,17 +2,17 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Update\DbDumpTest.
+ * Contains \Drupal\KernelTests\Core\Command\DbDumpTest.
  */
 
-namespace Drupal\system\Tests\Update;
+namespace Drupal\KernelTests\Core\Command;
 
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Command\DbDumpApplication;
 use Drupal\Core\Config\DatabaseStorage;
 use Drupal\Core\Database\Database;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\user\Entity\User;
 use Symfony\Component\Console\Tester\CommandTester;
 use Symfony\Component\DependencyInjection\Reference;
@@ -71,8 +71,8 @@ class DbDumpTest extends KernelTestBase {
    *
    * Register a database cache backend rather than memory-based.
    */
-  public function containerBuild(ContainerBuilder $container) {
-    parent::containerBuild($container);
+  public function register(ContainerBuilder $container) {
+    parent::register($container);
     $container->register('cache_factory', 'Drupal\Core\Cache\DatabaseBackendFactory')
       ->addArgument(new Reference('database'))
       ->addArgument(new Reference('cache_tags.invalidator.checksum'));
@@ -126,6 +126,7 @@ protected function setUp() {
       'cachetags',
       'config',
       'cache_bootstrap',
+      'cache_config',
       'cache_data',
       'cache_default',
       'cache_discovery',
diff --git a/core/modules/system/src/Tests/System/IgnoreReplicaSubscriberTest.php b/core/tests/Drupal/KernelTests/Core/EventSubscriber/IgnoreReplicaSubscriberTest.php
similarity index 89%
rename from core/modules/system/src/Tests/System/IgnoreReplicaSubscriberTest.php
rename to core/tests/Drupal/KernelTests/Core/EventSubscriber/IgnoreReplicaSubscriberTest.php
index 0ba18d6..5cc35f0 100644
--- a/core/modules/system/src/Tests/System/IgnoreReplicaSubscriberTest.php
+++ b/core/tests/Drupal/KernelTests/Core/EventSubscriber/IgnoreReplicaSubscriberTest.php
@@ -2,15 +2,15 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\System\IgnoreReplicaSubscriberTest.
+ * Contains \Drupal\KernelTests\Core\EventSubscriber\IgnoreReplicaSubscriberTest.
  */
 
-namespace Drupal\system\Tests\System;
+namespace Drupal\KernelTests\Core\EventSubscriber;
 
 use Drupal\Core\Database\Database;
 use Drupal\Core\EventSubscriber\ReplicaDatabaseIgnoreSubscriber;
 use Drupal\Core\DrupalKernel;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
diff --git a/core/modules/system/src/Tests/Module/ModuleImplementsAlterTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php
similarity index 93%
rename from core/modules/system/src/Tests/Module/ModuleImplementsAlterTest.php
rename to core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php
index 2a34c20..ba43b18 100644
--- a/core/modules/system/src/Tests/Module/ModuleImplementsAlterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php
@@ -2,12 +2,12 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Module\ModuleImplementsAlterTest.
+ * Contains \Drupal\KernelTests\Core\Extension\ModuleImplementsAlterTest.
  */
 
-namespace Drupal\system\Tests\Module;
+namespace Drupal\KernelTests\Core\Extension;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests hook_module_implements_alter().
@@ -17,6 +17,11 @@
 class ModuleImplementsAlterTest extends KernelTestBase {
 
   /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['system'];
+
+  /**
    * Tests hook_module_implements_alter() adding an implementation.
    *
    * @see \Drupal\Core\Extension\ModuleHandler::buildImplementationInfo()
diff --git a/core/modules/system/src/Tests/File/DirectoryTest.php b/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php
similarity index 98%
rename from core/modules/system/src/Tests/File/DirectoryTest.php
rename to core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php
index 4c15a8e..57063fa 100644
--- a/core/modules/system/src/Tests/File/DirectoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\DirectoryTest.
+ * Contains \Drupal\KernelTests\Core\File\DirectoryTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 use Drupal\Component\PhpStorage\FileStorage;
 
@@ -15,6 +15,7 @@
  * @group File
  */
 class DirectoryTest extends FileTestBase {
+
   /**
    * Test local directory handling functions.
    */
@@ -82,7 +83,7 @@ function testFileCheckDirectoryHandling() {
       $this->assertFalse(file_prepare_directory($directory, 0), 'Error reported for a non-writeable directory.', 'File');
 
       // Test directory permission modification.
-      $this->settingsSet('file_chmod_directory', 0777);
+      $this->setSetting('file_chmod_directory', 0777);
       $this->assertTrue(file_prepare_directory($directory, FILE_MODIFY_PERMISSIONS), 'No error reported when making directory writeable.', 'File');
     }
 
diff --git a/core/modules/system/src/Tests/File/FileTestBase.php b/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php
similarity index 82%
rename from core/modules/system/src/Tests/File/FileTestBase.php
rename to core/tests/Drupal/KernelTests/Core/File/FileTestBase.php
index 93e998d..18ffc23 100644
--- a/core/modules/system/src/Tests/File/FileTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php
@@ -2,12 +2,13 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\FileTestBase.
+ * Contains \Drupal\KernelTests\Core\File\FileTestBase.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Base class for file tests that adds some additional file specific
@@ -36,17 +37,46 @@
    */
   protected $classname;
 
+  /**
+   * {@inheritdoc}
+   */
   protected function setUp() {
     parent::setUp();
-    $this->installConfig(array('system'));
-    $this->registerStreamWrapper('private', 'Drupal\Core\StreamWrapper\PrivateStream');
+
+    \Drupal::configFactory()->getEditable('system.file')->set('default_scheme', 'public')->save();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function register(ContainerBuilder $container) {
+    parent::register($container);
+
+    $container->register('stream_wrapper.private', 'Drupal\Core\StreamWrapper\PrivateStream')
+      ->addTag('stream_wrapper', ['scheme' => 'private']);
 
     if (isset($this->scheme)) {
-      $this->registerStreamWrapper($this->scheme, $this->classname);
+      $container->register('stream_wrapper.' . $this->scheme, $this->classname)
+        ->addTag('stream_wrapper', ['scheme' => $this->scheme]);
     }
   }
 
   /**
+   * {@inheritdoc}
+   */
+  protected function setUpFilesystem() {
+    $public_file_directory = $this->siteDirectory . '/files';
+
+    require_once 'core/includes/file.inc';
+
+    mkdir($this->siteDirectory, 0775);
+    mkdir($this->siteDirectory . '/files', 0775);
+    mkdir($this->siteDirectory . '/files/config/' . CONFIG_SYNC_DIRECTORY, 0775, TRUE);
+
+    $this->setSetting('file_public_path', $public_file_directory);
+  }
+
+  /**
    * Helper function to test the permissions of a file.
    *
    * @param $filepath
diff --git a/core/modules/system/src/Tests/File/HtaccessUnitTest.php b/core/tests/Drupal/KernelTests/Core/File/HtaccessUnitTest.php
similarity index 93%
rename from core/modules/system/src/Tests/File/HtaccessUnitTest.php
rename to core/tests/Drupal/KernelTests/Core/File/HtaccessUnitTest.php
index 4b7f39d..490f967 100644
--- a/core/modules/system/src/Tests/File/HtaccessUnitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/HtaccessUnitTest.php
@@ -5,10 +5,11 @@
  * Contains \Drupal\system\Tests\File\HtaccessUnitTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 use Drupal\Component\Utility\SafeMarkup;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\Core\Site\Settings;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests .htaccess file saving.
@@ -22,8 +23,8 @@ class HtaccessUnitTest extends KernelTestBase {
    */
   function testHtaccessSave() {
     // Prepare test directories.
-    $public = $this->publicFilesDirectory . '/test/public';
-    $private = $this->publicFilesDirectory . '/test/private';
+    $public = Settings::get('file_public_path') . '/test/public';
+    $private = Settings::get('file_public_path') . '/test/private';
     $stream = 'public://test/stream';
 
     // Verify that file_save_htaccess() returns FALSE if .htaccess cannot be
diff --git a/core/modules/system/src/Tests/File/MimeTypeTest.php b/core/tests/Drupal/KernelTests/Core/File/MimeTypeTest.php
similarity index 97%
rename from core/modules/system/src/Tests/File/MimeTypeTest.php
rename to core/tests/Drupal/KernelTests/Core/File/MimeTypeTest.php
index 6324bf0..fcf890a 100644
--- a/core/modules/system/src/Tests/File/MimeTypeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/MimeTypeTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\MimeTypeTest.
+ * Contains \Drupal\KernelTests\Core\File\MimeTypeTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests filename mimetype detection.
diff --git a/core/modules/system/src/Tests/File/NameMungingTest.php b/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php
similarity index 97%
rename from core/modules/system/src/Tests/File/NameMungingTest.php
rename to core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php
index 3afd273..a5ab799 100644
--- a/core/modules/system/src/Tests/File/NameMungingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\NameMungingTest.
+ * Contains \Drupal\KernelTests\Core\File\NameMungingTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests filename munging and unmunging.
diff --git a/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php b/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php
similarity index 97%
rename from core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php
rename to core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php
index 4e43d3e..c3c3155 100644
--- a/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\ReadOnlyStreamWrapperTest.
+ * Contains \Drupal\KernelTests\Core\File\ReadOnlyStreamWrapperTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests the read-only stream wrapper write functions.
diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedCopyTest.php b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedCopyTest.php
similarity index 86%
rename from core/modules/system/src/Tests/File/RemoteFileUnmanagedCopyTest.php
rename to core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedCopyTest.php
index bf2a518..26868a5 100644
--- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedCopyTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedCopyTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\RemoteFileUnmanagedCopyTest.
+ * Contains \Drupal\KernelTests\Core\File\RemoteFileUnmanagedCopyTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests the unmanaged file copy function.
diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedDeleteRecursiveTest.php
similarity index 86%
rename from core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php
rename to core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedDeleteRecursiveTest.php
index 0eb8c2f..5ef8807 100644
--- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedDeleteRecursiveTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\RemoteFileUnmanagedDeleteRecursiveTest.
+ * Contains \Drupal\KernelTests\Core\File\RemoteFileUnmanagedDeleteRecursiveTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests the unmanaged file delete recursive function.
diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteTest.php b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedDeleteTest.php
similarity index 86%
rename from core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteTest.php
rename to core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedDeleteTest.php
index 0fc0368..56ea976 100644
--- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedDeleteTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\RemoteFileUnmanagedDeleteTest.
+ * Contains \Drupal\KernelTests\Core\File\RemoteFileUnmanagedDeleteTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests the unmanaged file delete function.
diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedMoveTest.php b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedMoveTest.php
similarity index 86%
rename from core/modules/system/src/Tests/File/RemoteFileUnmanagedMoveTest.php
rename to core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedMoveTest.php
index 41e2f6c..32723e6 100644
--- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedMoveTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedMoveTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\RemoteFileUnmanagedMoveTest.
+ * Contains \Drupal\KernelTests\Core\File\RemoteFileUnmanagedMoveTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests the unmanaged file move function.
diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedSaveDataTest.php b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedSaveDataTest.php
similarity index 86%
rename from core/modules/system/src/Tests/File/RemoteFileUnmanagedSaveDataTest.php
rename to core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedSaveDataTest.php
index 4c43330..7a210d8 100644
--- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedSaveDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/RemoteFileUnmanagedSaveDataTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\RemoteFileUnmanagedSaveDataTest.
+ * Contains \Drupal\KernelTests\Core\File\RemoteFileUnmanagedSaveDataTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests the unmanaged file save data function.
diff --git a/core/modules/system/src/Tests/File/ScanDirectoryTest.php b/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php
similarity index 98%
rename from core/modules/system/src/Tests/File/ScanDirectoryTest.php
rename to core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php
index 4b067f0..fd21ce3 100644
--- a/core/modules/system/src/Tests/File/ScanDirectoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\ScanDirectoryTest.
+ * Contains \Drupal\KernelTests\Core\File\ScanDirectoryTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests the file_scan_directory() function.
diff --git a/core/modules/system/src/Tests/File/StreamWrapperTest.php b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
similarity index 96%
rename from core/modules/system/src/Tests/File/StreamWrapperTest.php
rename to core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
index 5816861..333d7df 100644
--- a/core/modules/system/src/Tests/File/StreamWrapperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
@@ -2,14 +2,15 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\StreamWrapperTest.
+ * Contains \Drupal\KernelTests\Core\File\StreamWrapperTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Site\Settings;
 use Drupal\Core\StreamWrapper\PublicStream;
+use Drupal\KernelTests\Core\File\FileTestBase;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -41,14 +42,12 @@ class StreamWrapperTest extends FileTestBase {
   protected $classname = 'Drupal\file_test\StreamWrapper\DummyStreamWrapper';
 
   function setUp() {
+    parent::setUp();
+
     // Add file_private_path setting.
-    $settings = Settings::getAll();
     $request = Request::create('/');;
     $site_path = DrupalKernel::findSitePath($request);
-    $settings['file_private_path'] = $site_path . '/private';
-    new Settings($settings + Settings::getAll());
-
-    parent::setUp();
+    $this->setSetting('file_private_path', $site_path . '/private');
   }
 
   /**
diff --git a/core/modules/system/src/Tests/File/UnmanagedCopyTest.php b/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php
similarity index 97%
rename from core/modules/system/src/Tests/File/UnmanagedCopyTest.php
rename to core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php
index 22a0615..0e03031 100644
--- a/core/modules/system/src/Tests/File/UnmanagedCopyTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UnmanagedCopyTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\UnmanagedCopyTest.
+ * Contains \Drupal\KernelTests\Core\File\UnmanagedCopyTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 use Drupal\Core\Site\Settings;
 use Drupal\Core\File\FileSystem;
diff --git a/core/modules/system/src/Tests/File/UnmanagedDeleteRecursiveTest.php b/core/tests/Drupal/KernelTests/Core/File/UnmanagedDeleteRecursiveTest.php
similarity index 95%
rename from core/modules/system/src/Tests/File/UnmanagedDeleteRecursiveTest.php
rename to core/tests/Drupal/KernelTests/Core/File/UnmanagedDeleteRecursiveTest.php
index abef365..5537865 100644
--- a/core/modules/system/src/Tests/File/UnmanagedDeleteRecursiveTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UnmanagedDeleteRecursiveTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\UnmanagedDeleteRecursiveTest.
+ * Contains \Drupal\KernelTests\Core\File\UnmanagedDeleteRecursiveTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests the unmanaged file delete recursive function.
diff --git a/core/modules/system/src/Tests/File/UnmanagedDeleteTest.php b/core/tests/Drupal/KernelTests/Core/File/UnmanagedDeleteTest.php
similarity index 91%
rename from core/modules/system/src/Tests/File/UnmanagedDeleteTest.php
rename to core/tests/Drupal/KernelTests/Core/File/UnmanagedDeleteTest.php
index 5cdcfe8..f8b6eb9 100644
--- a/core/modules/system/src/Tests/File/UnmanagedDeleteTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UnmanagedDeleteTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\UnmanagedDeleteTest.
+ * Contains \Drupal\KernelTests\Core\File\UnmanagedDeleteTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests the unmanaged file delete function.
diff --git a/core/modules/system/src/Tests/File/UnmanagedMoveTest.php b/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php
similarity index 96%
rename from core/modules/system/src/Tests/File/UnmanagedMoveTest.php
rename to core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php
index 4a4e9e9..282fa53 100644
--- a/core/modules/system/src/Tests/File/UnmanagedMoveTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UnmanagedMoveTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\UnmanagedMoveTest.
+ * Contains \Drupal\KernelTests\Core\File\UnmanagedMoveTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 use Drupal\Core\Site\Settings;
 use Drupal\Core\File\FileSystem;
diff --git a/core/modules/system/src/Tests/File/UnmanagedSaveDataTest.php b/core/tests/Drupal/KernelTests/Core/File/UnmanagedSaveDataTest.php
similarity index 87%
rename from core/modules/system/src/Tests/File/UnmanagedSaveDataTest.php
rename to core/tests/Drupal/KernelTests/Core/File/UnmanagedSaveDataTest.php
index 2d3342c..2370760 100644
--- a/core/modules/system/src/Tests/File/UnmanagedSaveDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UnmanagedSaveDataTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\UnmanagedSaveDataTest.
+ * Contains \Drupal\KernelTests\Core\File\UnmanagedSaveDataTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 /**
  * Tests the file_unmanaged_save_data() function.
@@ -18,7 +18,7 @@ class UnmanagedSaveDataTest extends FileTestBase {
    */
   function testFileSaveData() {
     $contents = $this->randomMachineName(8);
-    $this->settingsSet('file_chmod_file', 0777);
+    $this->setSetting('file_chmod_file', 0777);
 
     // No filename.
     $filepath = file_unmanaged_save_data($contents);
diff --git a/core/modules/system/src/Tests/File/UrlRewritingTest.php b/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php
similarity index 98%
rename from core/modules/system/src/Tests/File/UrlRewritingTest.php
rename to core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php
index dd37222..901231e 100644
--- a/core/modules/system/src/Tests/File/UrlRewritingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\File\UrlRewritingTest.
+ * Contains \Drupal\KernelTests\Core\File\UrlRewritingTest.
  */
 
-namespace Drupal\system\Tests\File;
+namespace Drupal\KernelTests\Core\File;
 
 use Symfony\Component\HttpFoundation\Request;
 
diff --git a/core/modules/system/src/Tests/Form/ExternalFormUrlTest.php b/core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php
similarity index 89%
rename from core/modules/system/src/Tests/Form/ExternalFormUrlTest.php
rename to core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php
index f179ec9..a512668 100644
--- a/core/modules/system/src/Tests/Form/ExternalFormUrlTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php
@@ -2,14 +2,14 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Form\ExternalFormUrlTest.
+ * Contains \Drupal\KernelTests\Core\Form\ExternalFormUrlTest.
  */
 
-namespace Drupal\system\Tests\Form;
+namespace Drupal\KernelTests\Core\Form;
 
 use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\user\Entity\User;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -67,7 +67,6 @@ protected function setUp() {
     ]);
     $test_user->save();
     \Drupal::service('current_user')->setAccount($test_user);
-
   }
 
   /**
@@ -77,7 +76,11 @@ public function testActionUrlBehavior() {
     // Create a new request which has a request uri with multiple leading
     // slashes and make it the master request.
     $request_stack = \Drupal::service('request_stack');
+    /** @var \Symfony\Component\HttpFoundation\RequestStack $original_request */
     $original_request = $request_stack->pop();
+    // Just request some more so there is no request left.
+    $request_stack->pop();
+    $request_stack->pop();
     $request = Request::create($original_request->getSchemeAndHttpHost() . '//example.org');
     $request_stack->push($request);
 
diff --git a/core/modules/system/src/Tests/Form/FormCacheTest.php b/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php
similarity index 96%
rename from core/modules/system/src/Tests/Form/FormCacheTest.php
rename to core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php
index 77d259e..ec2c552 100644
--- a/core/modules/system/src/Tests/Form/FormCacheTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php
@@ -2,15 +2,15 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Form\FormCacheTest.
+ * Contains \Drupal\KernelTests\Core\Form\FormCacheTest.
  */
 
-namespace Drupal\system\Tests\Form;
+namespace Drupal\KernelTests\Core\Form;
 
 use Drupal\Core\Form\FormState;
 use Drupal\Core\Session\AnonymousUserSession;
 use Drupal\Core\Session\UserSession;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests \Drupal::formBuilder()->setCache() and
diff --git a/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php b/core/tests/Drupal/KernelTests/Core/Form/FormDefaultHandlersTest.php
similarity index 95%
rename from core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php
rename to core/tests/Drupal/KernelTests/Core/Form/FormDefaultHandlersTest.php
index 94187af..21bf4be 100644
--- a/core/modules/system/src/Tests/Form/FormDefaultHandlersTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/FormDefaultHandlersTest.php
@@ -2,15 +2,15 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Form\FormDefaultHandlersTest.
+ * Contains \Drupal\KernelTests\Core\Form\FormDefaultHandlersTest.
  */
 
-namespace Drupal\system\Tests\Form;
+namespace Drupal\KernelTests\Core\Form;
 
 use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Form\FormState;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests automatically added form handlers.
diff --git a/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php b/core/tests/Drupal/KernelTests/Core/Form/TriggeringElementProgrammedUnitTest.php
similarity index 95%
rename from core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php
rename to core/tests/Drupal/KernelTests/Core/Form/TriggeringElementProgrammedUnitTest.php
index ae6b82c..d63eb4c 100644
--- a/core/modules/system/src/Tests/Form/TriggeringElementProgrammedUnitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/TriggeringElementProgrammedUnitTest.php
@@ -5,12 +5,12 @@
  * Contains \Drupal\system\Tests\Form\TriggeringElementProgrammedUnitTest.
  */
 
-namespace Drupal\system\Tests\Form;
+namespace Drupal\KernelTests\Core\Form;
 
 use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Form\FormState;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests detection of triggering_element for programmed form submissions.
@@ -19,8 +19,6 @@
  */
 class TriggeringElementProgrammedUnitTest extends KernelTestBase implements FormInterface {
 
-  public static $modules = array('system');
-
   /**
    * {@inheritdoc}
    */
diff --git a/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/HttpKernel/StackKernelIntegrationTest.php
similarity index 94%
rename from core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php
rename to core/tests/Drupal/KernelTests/Core/HttpKernel/StackKernelIntegrationTest.php
index d976b37..c4d7ec7 100644
--- a/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/HttpKernel/StackKernelIntegrationTest.php
@@ -5,10 +5,10 @@
  * Contains \Drupal\system\Tests\HttpKernel\StackKernelIntegrationTest.
  */
 
-namespace Drupal\system\Tests\HttpKernel;
+namespace Drupal\KernelTests\Core\HttpKernel;
 
-use Drupal\simpletest\KernelTestBase;
 use Drupal\Core\Url;
+use Drupal\KernelTests\KernelTestBase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
 
@@ -57,7 +57,7 @@ public function testLazyLateMiddlewares() {
     $this->assertFalse($this->container->getDefinition('http_kernel.basic')->isLazy(), 'lazy flag on http_kernel.basic definition is not set');
 
     \Drupal::service('module_installer')->install(['page_cache']);
-    $this->container = $this->kernel->rebuildContainer();
+    $this->container = \Drupal::service('kernel')->rebuildContainer();
 
     $this->assertFalse($this->container->getDefinition('http_middleware.reverse_proxy')->isLazy(), 'lazy flag on http_middleware.reverse_proxy definition is not set');
     $this->assertFalse($this->container->getDefinition('http_middleware.page_cache')->isLazy(), 'lazy flag on http_middleware.page_cache definition is not set');
diff --git a/core/modules/system/src/Tests/Installer/InstallerLanguageTest.php b/core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php
similarity index 96%
rename from core/modules/system/src/Tests/Installer/InstallerLanguageTest.php
rename to core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php
index 417cfd0..3d798b0 100644
--- a/core/modules/system/src/Tests/Installer/InstallerLanguageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php
@@ -5,10 +5,10 @@
  * Contains \Drupal\system\Tests\Installer\InstallerLanguageTest.
  */
 
-namespace Drupal\system\Tests\Installer;
+namespace Drupal\KernelTests\Core\Installer;
 
-use Drupal\simpletest\KernelTestBase;
 use Drupal\Core\StringTranslation\Translator\FileTranslation;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests for installer language support.
diff --git a/core/modules/system/src/Tests/KeyValueStore/DatabaseStorageExpirableTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
similarity index 96%
rename from core/modules/system/src/Tests/KeyValueStore/DatabaseStorageExpirableTest.php
rename to core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
index 944c9a1..7165439 100644
--- a/core/modules/system/src/Tests/KeyValueStore/DatabaseStorageExpirableTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\KeyValueStore\DatabaseStorageExpirableTest.
+ * Contains \Drupal\KernelTests\Core\KeyValueStore\DatabaseStorageExpirableTest.
  */
 
-namespace Drupal\system\Tests\KeyValueStore;
+namespace Drupal\KernelTests\Core\KeyValueStore;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\KeyValueStore\KeyValueFactory;
@@ -33,8 +33,8 @@ protected function setUp() {
   /**
    * {@inheritdoc}
    */
-  public function containerBuild(ContainerBuilder $container) {
-    parent::containerBuild($container);
+  public function register(ContainerBuilder $container) {
+    parent::register($container);
 
     $parameter[KeyValueFactory::DEFAULT_SETTING] = 'keyvalue.expirable.database';
     $container->setParameter('factory.keyvalue.expirable', $parameter);
diff --git a/core/modules/system/src/Tests/KeyValueStore/DatabaseStorageTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
similarity index 74%
rename from core/modules/system/src/Tests/KeyValueStore/DatabaseStorageTest.php
rename to core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
index dd9e44c..6fc42a1 100644
--- a/core/modules/system/src/Tests/KeyValueStore/DatabaseStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\KeyValueStore\DatabaseStorageTest.
+ * Contains \Drupal\KernelTests\Core\KeyValueStore\DatabaseStorageTest.
  */
 
-namespace Drupal\system\Tests\KeyValueStore;
+namespace Drupal\KernelTests\Core\KeyValueStore;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\KeyValueStore\KeyValueFactory;
@@ -32,8 +32,8 @@ protected function setUp() {
   /**
    * {@inheritdoc}
    */
-  public function containerBuild(ContainerBuilder $container) {
-    parent::containerBuild($container);
+  public function register(ContainerBuilder $container) {
+    parent::register($container);
 
     $parameter[KeyValueFactory::DEFAULT_SETTING] = 'keyvalue.database';
     $container->setParameter('factory.keyvalue', $parameter);
diff --git a/core/modules/system/src/Tests/KeyValueStore/GarbageCollectionTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php
similarity index 92%
rename from core/modules/system/src/Tests/KeyValueStore/GarbageCollectionTest.php
rename to core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php
index 4a39c6f..fa8c0a7 100644
--- a/core/modules/system/src/Tests/KeyValueStore/GarbageCollectionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php
@@ -2,15 +2,15 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\KeyValueStore\GarbageCollectionTest.
+ * Contains \Drupal\KernelTests\Core\KeyValueStore\GarbageCollectionTest.
  */
 
-namespace Drupal\system\Tests\KeyValueStore;
+namespace Drupal\KernelTests\Core\KeyValueStore;
 
 use Drupal\Component\Serialization\PhpSerialize;
 use Drupal\Core\Database\Database;
 use Drupal\Core\KeyValueStore\DatabaseStorageExpirable;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests garbage collection for the expirable key-value database storage.
diff --git a/core/modules/system/src/Tests/KeyValueStore/KeyValueContentEntityStorageTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php
similarity index 99%
rename from core/modules/system/src/Tests/KeyValueStore/KeyValueContentEntityStorageTest.php
rename to core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php
index cd09af9..efc6b68 100644
--- a/core/modules/system/src/Tests/KeyValueStore/KeyValueContentEntityStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php
@@ -5,7 +5,7 @@
  * Contains \Drupal\system\Tests\KeyValueStore\KeyValueContentEntityStorageTest.
  */
 
-namespace Drupal\system\Tests\KeyValueStore;
+namespace Drupal\KernelTests\Core\KeyValueStore;
 
 use Drupal\Core\Entity\EntityMalformedException;
 use Drupal\Core\Entity\EntityStorageException;
diff --git a/core/modules/system/src/Tests/KeyValueStore/MemoryStorageTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php
similarity index 79%
rename from core/modules/system/src/Tests/KeyValueStore/MemoryStorageTest.php
rename to core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php
index 4c6ac0c..8d10b69 100644
--- a/core/modules/system/src/Tests/KeyValueStore/MemoryStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php
@@ -5,7 +5,7 @@
  * Contains \Drupal\system\Tests\KeyValueStore\MemoryStorageTest.
  */
 
-namespace Drupal\system\Tests\KeyValueStore;
+namespace Drupal\KernelTests\Core\KeyValueStore;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\KeyValueStore\KeyValueFactory;
@@ -20,8 +20,8 @@ class MemoryStorageTest extends StorageTestBase {
   /**
    * {@inheritdoc}
    */
-  public function containerBuild(ContainerBuilder $container) {
-    parent::containerBuild($container);
+  public function register(ContainerBuilder $container) {
+    parent::register($container);
 
     $container->register('keyvalue.memory', 'Drupal\Core\KeyValueStore\KeyValueMemoryFactory');
     $parameter[KeyValueFactory::DEFAULT_SETTING] = 'keyvalue.memory';
diff --git a/core/modules/system/src/Tests/KeyValueStore/StorageTestBase.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
similarity index 98%
rename from core/modules/system/src/Tests/KeyValueStore/StorageTestBase.php
rename to core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
index dd9b248..7c39ef5 100644
--- a/core/modules/system/src/Tests/KeyValueStore/StorageTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
@@ -5,9 +5,9 @@
  * Contains \Drupal\system\Tests\KeyValueStore\StorageTestBase.
  */
 
-namespace Drupal\system\Tests\KeyValueStore;
+namespace Drupal\KernelTests\Core\KeyValueStore;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Base class for testing key-value storages.
diff --git a/core/modules/system/src/Tests/Lock/LockUnitTest.php b/core/tests/Drupal/KernelTests/Core/Lock/LockUnitTest.php
similarity index 96%
rename from core/modules/system/src/Tests/Lock/LockUnitTest.php
rename to core/tests/Drupal/KernelTests/Core/Lock/LockUnitTest.php
index b726add..f4c3393 100644
--- a/core/modules/system/src/Tests/Lock/LockUnitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Lock/LockUnitTest.php
@@ -5,10 +5,10 @@
  * Contains \Drupal\system\Tests\Lock\LockUnitTest.
  */
 
-namespace Drupal\system\Tests\Lock;
+namespace Drupal\KernelTests\Core\Lock;
 
 use Drupal\Core\Lock\DatabaseLockBackend;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests the Database lock backend.
diff --git a/core/modules/system/src/Tests/Menu/MenuLinkDefaultIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkDefaultIntegrationTest.php
similarity index 95%
rename from core/modules/system/src/Tests/Menu/MenuLinkDefaultIntegrationTest.php
rename to core/tests/Drupal/KernelTests/Core/Menu/MenuLinkDefaultIntegrationTest.php
index d96b29c..560f156 100644
--- a/core/modules/system/src/Tests/Menu/MenuLinkDefaultIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkDefaultIntegrationTest.php
@@ -5,10 +5,10 @@
  * Contains \Drupal\system\Tests\Menu\MenuLinkDefaultIntegrationTest.
  */
 
-namespace Drupal\system\Tests\Menu;
+namespace Drupal\KernelTests\Core\Menu;
 
 use Drupal\Core\Menu\MenuTreeParameters;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests integration of static menu links.
@@ -23,7 +23,6 @@ class MenuLinkDefaultIntegrationTest extends KernelTestBase {
    * @var array
    */
   public static $modules = array(
-    'system',
     'menu_test',
   );
 
diff --git a/core/modules/system/src/Tests/Menu/MenuLinkTreeTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
similarity index 97%
rename from core/modules/system/src/Tests/Menu/MenuLinkTreeTest.php
rename to core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
index 04e366a..181602a 100644
--- a/core/modules/system/src/Tests/Menu/MenuLinkTreeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
@@ -2,14 +2,14 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Menu\MenuLinkTreeTest.
+ * Contains \Drupal\KernelTests\Core\Menu\MenuLinkTreeTest.
  */
 
-namespace Drupal\system\Tests\Menu;
+namespace Drupal\KernelTests\Core\Menu;
 
 use Drupal\Core\Menu\MenuLinkTreeElement;
 use Drupal\Core\Menu\MenuTreeParameters;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\Tests\Core\Menu\MenuLinkMock;
 
 /**
diff --git a/core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
similarity index 99%
rename from core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php
rename to core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
index 482eea9..a82a87e 100644
--- a/core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
@@ -5,12 +5,12 @@
  * Contains \Drupal\system\Tests\Menu\MenuTreeStorageTest.
  */
 
-namespace Drupal\system\Tests\Menu;
+namespace Drupal\KernelTests\Core\Menu;
 
 use Drupal\Component\Plugin\Exception\PluginException;
 use Drupal\Core\Menu\MenuTreeParameters;
 use Drupal\Core\Menu\MenuTreeStorage;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests the menu tree storage.
@@ -36,13 +36,6 @@ class MenuTreeStorageTest extends KernelTestBase {
   protected $connection;
 
   /**
-   * Modules to enable.
-   *
-   * @var array
-   */
-  public static $modules = array('system');
-
-  /**
    * {@inheritdoc}
    */
   protected function setUp() {
diff --git a/core/modules/system/src/Tests/Path/AliasTest.php b/core/tests/Drupal/KernelTests/Core/Path/AliasTest.php
similarity index 99%
rename from core/modules/system/src/Tests/Path/AliasTest.php
rename to core/tests/Drupal/KernelTests/Core/Path/AliasTest.php
index 2ceb4c9..22373b3 100644
--- a/core/modules/system/src/Tests/Path/AliasTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Path/AliasTest.php
@@ -5,7 +5,7 @@
  * Contains \Drupal\system\Tests\Path\AliasTest.
  */
 
-namespace Drupal\system\Tests\Path;
+namespace Drupal\KernelTests\Core\Path;
 
 use Drupal\Core\Cache\MemoryCounterBackend;
 use Drupal\Core\Path\AliasStorage;
diff --git a/core/modules/system/src/Tests/Path/PathUnitTestBase.php b/core/tests/Drupal/KernelTests/Core/Path/PathUnitTestBase.php
similarity index 85%
rename from core/modules/system/src/Tests/Path/PathUnitTestBase.php
rename to core/tests/Drupal/KernelTests/Core/Path/PathUnitTestBase.php
index f007750..b05e13e 100644
--- a/core/modules/system/src/Tests/Path/PathUnitTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Path/PathUnitTestBase.php
@@ -5,10 +5,11 @@
  * Contains \Drupal\system\Tests\Path\PathUnitTestBase.
  */
 
-namespace Drupal\system\Tests\Path;
+namespace Drupal\KernelTests\Core\Path;
 
-use Drupal\simpletest\KernelTestBase;
 use Drupal\Core\Database\Database;
+use Drupal\KernelTests\KernelTestBase;
+use Drupal\system\Tests\Path\UrlAliasFixtures;
 
 /**
  * Base class for Path/URL alias integration tests.
diff --git a/core/modules/system/src/Tests/Plugin/Condition/RequestPathTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php
similarity index 96%
rename from core/modules/system/src/Tests/Plugin/Condition/RequestPathTest.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php
index 7a53844..71cb8f4 100644
--- a/core/modules/system/src/Tests/Plugin/Condition/RequestPathTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php
@@ -2,13 +2,13 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Plugin\Condition\RequestPathTest.
+ * Contains \Drupal\KernelTests\Core\Plugin\Condition\RequestPathTest.
  */
 
-namespace Drupal\system\Tests\Plugin\Condition;
+namespace Drupal\KernelTests\Core\Plugin\Condition;
 
 use Drupal\Core\Path\CurrentPathStack;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\system\Tests\Routing\MockAliasManager;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
diff --git a/core/modules/system/src/Tests/Plugin/ContextPluginTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php
similarity index 98%
rename from core/modules/system/src/Tests/Plugin/ContextPluginTest.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php
index 4a9b73a..0104d01 100644
--- a/core/modules/system/src/Tests/Plugin/ContextPluginTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php
@@ -5,14 +5,14 @@
  * Contains \Drupal\system\Tests\Plugin\ContextPluginTest.
  */
 
-namespace Drupal\system\Tests\Plugin;
+namespace Drupal\KernelTests\Core\Plugin;
 
 use Drupal\Component\Plugin\Exception\ContextException;
 use Drupal\Core\Plugin\Context\ContextDefinition;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\node\Entity\Node;
 use Drupal\node\Entity\NodeType;
 use Drupal\plugin_test\Plugin\MockBlockManager;
-use Drupal\simpletest\KernelTestBase;
 use Drupal\user\Entity\User;
 
 /**
diff --git a/core/modules/system/src/Tests/Plugin/DerivativeTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/DerivativeTest.php
similarity index 97%
rename from core/modules/system/src/Tests/Plugin/DerivativeTest.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/DerivativeTest.php
index 793eeee..57a633c 100644
--- a/core/modules/system/src/Tests/Plugin/DerivativeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/DerivativeTest.php
@@ -5,7 +5,7 @@
  * Contains \Drupal\system\Tests\Plugin\DerivativeTest.
  */
 
-namespace Drupal\system\Tests\Plugin;
+namespace Drupal\KernelTests\Core\Plugin;
 
 /**
  * Tests that derivative plugins are correctly discovered.
diff --git a/core/modules/system/src/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
similarity index 98%
rename from core/modules/system/src/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
index d79db4d..ed63adf 100644
--- a/core/modules/system/src/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
@@ -5,7 +5,7 @@
  * Contains \Drupal\system\Tests\Plugin\Discovery\AnnotatedClassDiscoveryTest.
  */
 
-namespace Drupal\system\Tests\Plugin\Discovery;
+namespace Drupal\KernelTests\Core\Plugin\Discovery;
 
 use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
 
diff --git a/core/modules/system/src/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php
similarity index 96%
rename from core/modules/system/src/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php
index 890329c..8ad913f 100644
--- a/core/modules/system/src/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php
@@ -5,7 +5,7 @@
  * Contains \Drupal\system\Tests\Plugin\Discovery\CustomAnnotationClassDiscoveryTest.
  */
 
-namespace Drupal\system\Tests\Plugin\Discovery;
+namespace Drupal\KernelTests\Core\Plugin\Discovery;
 
 use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
 
diff --git a/core/modules/system/src/Tests/Plugin/Discovery/CustomDirectoryAnnotatedClassDiscoveryTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/CustomDirectoryAnnotatedClassDiscoveryTest.php
similarity index 98%
rename from core/modules/system/src/Tests/Plugin/Discovery/CustomDirectoryAnnotatedClassDiscoveryTest.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/Discovery/CustomDirectoryAnnotatedClassDiscoveryTest.php
index 2d33070..39938f8 100644
--- a/core/modules/system/src/Tests/Plugin/Discovery/CustomDirectoryAnnotatedClassDiscoveryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/CustomDirectoryAnnotatedClassDiscoveryTest.php
@@ -5,7 +5,7 @@
  * Contains \Drupal\system\Tests\Plugin\Discovery\CustomDirectoryAnnotatedClassDiscoveryTest.
  */
 
-namespace Drupal\system\Tests\Plugin\Discovery;
+namespace Drupal\KernelTests\Core\Plugin\Discovery;
 
 use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
 
diff --git a/core/modules/system/src/Tests/Plugin/Discovery/DiscoveryTestBase.php b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
similarity index 96%
rename from core/modules/system/src/Tests/Plugin/Discovery/DiscoveryTestBase.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
index b6f5cc1..a376c06 100644
--- a/core/modules/system/src/Tests/Plugin/Discovery/DiscoveryTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
@@ -5,10 +5,10 @@
  * Contains \Drupal\system\Tests\Plugin\Discovery\DiscoveryTestBase.
  */
 
-namespace Drupal\system\Tests\Plugin\Discovery;
+namespace Drupal\KernelTests\Core\Plugin\Discovery;
 
 use Drupal\Core\StringTranslation\TranslatableMarkup;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Base class for plugin discovery tests.
diff --git a/core/modules/system/src/Tests/Plugin/Discovery/StaticDiscoveryTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/StaticDiscoveryTest.php
similarity index 96%
rename from core/modules/system/src/Tests/Plugin/Discovery/StaticDiscoveryTest.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/Discovery/StaticDiscoveryTest.php
index c527e02..2fb493f 100644
--- a/core/modules/system/src/Tests/Plugin/Discovery/StaticDiscoveryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/StaticDiscoveryTest.php
@@ -5,7 +5,7 @@
  * Contains \Drupal\system\Tests\Plugin\Discovery\StaticDiscoveryTest.
  */
 
-namespace Drupal\system\Tests\Plugin\Discovery;
+namespace Drupal\KernelTests\Core\Plugin\Discovery;
 
 use Drupal\Component\Plugin\Discovery\StaticDiscovery;
 
diff --git a/core/modules/system/src/Tests/Plugin/FactoryTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/FactoryTest.php
similarity index 98%
rename from core/modules/system/src/Tests/Plugin/FactoryTest.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/FactoryTest.php
index 44cf55f..b97b234 100644
--- a/core/modules/system/src/Tests/Plugin/FactoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/FactoryTest.php
@@ -5,7 +5,7 @@
  * Contains \Drupal\system\Tests\Plugin\FactoryTest.
  */
 
-namespace Drupal\system\Tests\Plugin;
+namespace Drupal\KernelTests\Core\Plugin;
 
 use Drupal\Component\Plugin\Exception\ExceptionInterface;
 
diff --git a/core/modules/system/src/Tests/Plugin/InspectionTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/InspectionTest.php
similarity index 97%
rename from core/modules/system/src/Tests/Plugin/InspectionTest.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/InspectionTest.php
index 69f0a7e..90985f4 100644
--- a/core/modules/system/src/Tests/Plugin/InspectionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/InspectionTest.php
@@ -5,7 +5,7 @@
  * Contains \Drupal\system\Tests\Plugin\InspectionTest.
  */
 
-namespace Drupal\system\Tests\Plugin;
+namespace Drupal\KernelTests\Core\Plugin;
 
 /**
  * Tests that plugins implementing PluginInspectionInterface are inspectable.
diff --git a/core/modules/system/src/Tests/Plugin/PluginTestBase.php b/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php
similarity index 98%
rename from core/modules/system/src/Tests/Plugin/PluginTestBase.php
rename to core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php
index b4d6c1d..7710056 100644
--- a/core/modules/system/src/Tests/Plugin/PluginTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php
@@ -5,10 +5,10 @@
  * Contains \Drupal\system\Tests\Plugin\PluginTestBase.
  */
 
-namespace Drupal\system\Tests\Plugin;
+namespace Drupal\KernelTests\Core\Plugin;
 
 use Drupal\Core\Plugin\Context\ContextDefinition;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\plugin_test\Plugin\TestPluginManager;
 use Drupal\plugin_test\Plugin\MockBlockManager;
 use Drupal\plugin_test\Plugin\DefaultsTestPluginManager;
diff --git a/core/modules/system/src/Tests/Queue/QueueSerializationTest.php b/core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php
similarity index 96%
rename from core/modules/system/src/Tests/Queue/QueueSerializationTest.php
rename to core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php
index 4a35cce..1a0c60d 100644
--- a/core/modules/system/src/Tests/Queue/QueueSerializationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php
@@ -4,13 +4,13 @@
  * Contains \Drupal\system\Tests\Queue\QueueSerializationTest.
  */
 
-namespace Drupal\system\Tests\Queue;
+namespace Drupal\KernelTests\Core\Queue;
 
 use Drupal\Core\DependencyInjection\DependencySerializationTrait;
 use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Form\FormState;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\user\Entity\User;
 
 /**
diff --git a/core/modules/system/src/Tests/Queue/QueueTest.php b/core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php
similarity index 97%
rename from core/modules/system/src/Tests/Queue/QueueTest.php
rename to core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php
index a1ab45e..03656ae 100644
--- a/core/modules/system/src/Tests/Queue/QueueTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php
@@ -5,12 +5,12 @@
  * Contains \Drupal\system\Tests\Queue\QueueTest.
  */
 
-namespace Drupal\system\Tests\Queue;
+namespace Drupal\KernelTests\Core\Queue;
 
 use Drupal\Core\Database\Database;
 use Drupal\Core\Queue\DatabaseQueue;
 use Drupal\Core\Queue\Memory;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Queues and dequeues a set of items to check the basic queue functionality.
diff --git a/core/modules/system/src/Tests/Render/Element/TableTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php
similarity index 97%
rename from core/modules/system/src/Tests/Render/Element/TableTest.php
rename to core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php
index 827b55a..1b0b5a1 100644
--- a/core/modules/system/src/Tests/Render/Element/TableTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php
@@ -2,12 +2,12 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Render\Element\TableTest.
+ * Contains \Drupal\KernelTests\Core\Render\Element\TableTest.
  */
 
-namespace Drupal\system\Tests\Render\Element;
+namespace Drupal\KernelTests\Core\Render\Element;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests built-in table theme functions.
@@ -24,15 +24,6 @@ class TableTest extends KernelTestBase {
   public static $modules = ['system', 'form_test'];
 
   /**
-   * {@inheritdoc}
-   */
-  protected function setUp() {
-    parent::setUp();
-
-    \Drupal::service('router.builder')->rebuild();
-  }
-
-  /**
    * Tableheader.js provides 'sticky' table headers, and is included by default.
    */
   function testThemeTableStickyHeaders() {
diff --git a/core/modules/system/src/Tests/Render/ElementInfoIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Render/ElementInfoIntegrationTest.php
similarity index 94%
rename from core/modules/system/src/Tests/Render/ElementInfoIntegrationTest.php
rename to core/tests/Drupal/KernelTests/Core/Render/ElementInfoIntegrationTest.php
index 1620253..c8453ca 100644
--- a/core/modules/system/src/Tests/Render/ElementInfoIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/ElementInfoIntegrationTest.php
@@ -5,9 +5,9 @@
  * Contains \Drupal\system\Tests\Render\ElementInfoIntegrationTest.
  */
 
-namespace Drupal\system\Tests\Render;
+namespace Drupal\KernelTests\Core\Render;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests the element info.
diff --git a/core/modules/system/src/Tests/Render/RenderCacheTest.php b/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php
similarity index 96%
rename from core/modules/system/src/Tests/Render/RenderCacheTest.php
rename to core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php
index 975358c..b48ada6 100644
--- a/core/modules/system/src/Tests/Render/RenderCacheTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php
@@ -2,12 +2,12 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Render\RenderCacheTest.
+ * Contains \Drupal\KernelTests\Core\Render\RenderCacheTest.
  */
 
-namespace Drupal\system\Tests\Render;
+namespace Drupal\KernelTests\Core\Render;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\simpletest\UserCreationTrait;
 
 /**
diff --git a/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php b/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteNoneTest.php
similarity index 96%
rename from core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php
rename to core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteNoneTest.php
index f029156..bd4bf44 100644
--- a/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php
+++ b/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteNoneTest.php
@@ -2,15 +2,15 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\RouteProcessor\RouteNoneTest.
+ * Contains \Drupal\KernelTests\Core\RouteProcessor\RouteNoneTest.
  */
 
-namespace Drupal\system\Tests\RouteProcessor;
+namespace Drupal\KernelTests\Core\RouteProcessor;
 
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\GeneratedUrl;
 use Drupal\Core\Render\BubbleableMetadata;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\Routing\Route;
@@ -42,8 +42,6 @@ class RouteNoneTest extends KernelTestBase {
   protected function setUp() {
     parent::setUp();
 
-    \Drupal::service('router.builder')->rebuild();
-
     $this->urlGenerator = \Drupal::urlGenerator();
   }
 
diff --git a/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
similarity index 97%
rename from core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
rename to core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
index 8cdb9c7..75b9724 100644
--- a/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
@@ -5,12 +5,12 @@
  * Contains \Drupal\system\Tests\RouteProcessor\RouteProcessorCurrentIntegrationTest.
  */
 
-namespace Drupal\system\Tests\RouteProcessor;
+namespace Drupal\KernelTests\Core\RouteProcessor;
 
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\GeneratedUrl;
 use Drupal\Core\Render\BubbleableMetadata;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\Routing\Route;
@@ -41,8 +41,6 @@ class RouteProcessorCurrentIntegrationTest extends KernelTestBase {
   protected function setUp() {
     parent::setUp();
 
-    \Drupal::service('router.builder')->rebuild();
-
     $this->urlGenerator = \Drupal::urlGenerator();
   }
 
diff --git a/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php b/core/tests/Drupal/KernelTests/Core/Routing/ContentNegotiationRoutingTest.php
similarity index 92%
rename from core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php
rename to core/tests/Drupal/KernelTests/Core/Routing/ContentNegotiationRoutingTest.php
index 71d3fe2..43ff7e7 100644
--- a/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/ContentNegotiationRoutingTest.php
@@ -5,10 +5,10 @@
  * Contains \Drupal\system\Tests\Routing\ContentNegotiationRoutingTest.
  */
 
-namespace Drupal\system\Tests\Routing;
+namespace Drupal\KernelTests\Core\Routing;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
 
@@ -22,23 +22,13 @@ class ContentNegotiationRoutingTest extends KernelTestBase {
   /**
    * {@inheritdoc}
    */
-  public static $modules = ['system', 'conneg_test'];
+  public static $modules = ['conneg_test'];
 
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
-    \Drupal::unsetContainer();
-    parent::setUp();
-
-    \Drupal::service('router.builder')->rebuild();
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function containerBuild(ContainerBuilder $container) {
-    parent::containerBuild($container);
+  public function register(ContainerBuilder $container) {
+    parent::register($container);
 
     // \Drupal\simpletest\KernelTestBase::containerBuild() removes the alias path
     // processor.
diff --git a/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php b/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php
similarity index 97%
rename from core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php
rename to core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php
index a404916..04931a9 100644
--- a/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php
@@ -2,13 +2,13 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Routing\ExceptionHandlingTest.
+ * Contains \Drupal\KernelTests\Core\Routing\ExceptionHandlingTest.
  */
 
-namespace Drupal\system\Tests\Routing;
+namespace Drupal\KernelTests\Core\Routing;
 
 use Drupal\Component\Utility\Html;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
 
@@ -31,7 +31,6 @@ protected function setUp() {
     parent::setUp();
 
     $this->installEntitySchema('date_format');
-    \Drupal::service('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Routing/MatcherDumperTest.php b/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php
similarity index 97%
rename from core/modules/system/src/Tests/Routing/MatcherDumperTest.php
rename to core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php
index f98d294..bfc042d 100644
--- a/core/modules/system/src/Tests/Routing/MatcherDumperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php
@@ -2,14 +2,14 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Routing\MatcherDumperTest.
+ * Contains \Drupal\KernelTests\Core\Routing\MatcherDumperTest.
  */
 
-namespace Drupal\system\Tests\Routing;
+namespace Drupal\KernelTests\Core\Routing;
 
 use Drupal\Core\KeyValueStore\KeyValueMemoryFactory;
 use Drupal\Core\State\State;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Symfony\Component\Routing\Route;
 use Symfony\Component\Routing\RouteCollection;
 use Drupal\Core\Database\Database;
diff --git a/core/modules/system/src/Tests/Routing/RouteProviderTest.php b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
similarity index 98%
rename from core/modules/system/src/Tests/Routing/RouteProviderTest.php
rename to core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
index 056a37a..c0adfb0 100644
--- a/core/modules/system/src/Tests/Routing/RouteProviderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
@@ -1,11 +1,11 @@
-<?php
+2687897<?php
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Routing\RouteProviderTest.
+ * Contains \Drupal\KernelTests\Core\Routing\RouteProviderTest.
  */
 
-namespace Drupal\system\Tests\Routing;
+namespace Drupal\KernelTests\Core\Routing;
 
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\Core\Database\Database;
@@ -15,14 +15,14 @@
 use Drupal\Core\Routing\MatcherDumper;
 use Drupal\Core\Routing\RouteProvider;
 use Drupal\Core\State\State;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\Tests\Core\Routing\RoutingFixtures;
-use Drupal\simpletest\KernelTestBase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
 use Symfony\Component\Routing\Exception\RouteNotFoundException;
 use Symfony\Component\Routing\Route;
 use Symfony\Component\Routing\RouteCollection;
-use Symfony\Component\Routing\Exception\ResourceNotFoundException;
 
 /**
  * Confirm that the default route provider is working correctly.
@@ -91,8 +91,8 @@ protected function setUp() {
   /**
    * {@inheritdoc}
    */
-  public function containerBuild(ContainerBuilder $container) {
-    parent::containerBuild($container); // TODO: Change the autogenerated stub
+  public function register(ContainerBuilder $container) {
+    parent::register($container);
 
     // Readd the incoming path alias for these tests.
     if ($container->hasDefinition('path_processor_alias')) {
diff --git a/core/modules/system/src/Tests/Routing/UrlIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Routing/UrlIntegrationTest.php
similarity index 89%
rename from core/modules/system/src/Tests/Routing/UrlIntegrationTest.php
rename to core/tests/Drupal/KernelTests/Core/Routing/UrlIntegrationTest.php
index 1d3f934..27e2b2d 100644
--- a/core/modules/system/src/Tests/Routing/UrlIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/UrlIntegrationTest.php
@@ -2,13 +2,13 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Routing\UrlIntegrationTest.
+ * Contains \Drupal\KernelTests\Core\Routing\UrlIntegrationTest.
  */
 
-namespace Drupal\system\Tests\Routing;
+namespace Drupal\KernelTests\Core\Routing;
 
 use Drupal\Core\Url;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\user\Entity\Role;
 use Drupal\user\Entity\User;
 
@@ -30,7 +30,6 @@ class UrlIntegrationTest extends KernelTestBase {
    * Ensures that the access() method on \Drupal\Core\Url objects works.
    */
   public function testAccess() {
-    \Drupal::service('router.builder')->rebuild();
     /** @var \Drupal\user\RoleInterface $role_with_access */
     $role_with_access = Role::create(['id' => 'role_with_access']);
     $role_with_access->grantPermission('administer users');
diff --git a/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php b/core/tests/Drupal/KernelTests/Core/ServiceProvider/ServiceProviderTest.php
similarity index 89%
rename from core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php
rename to core/tests/Drupal/KernelTests/Core/ServiceProvider/ServiceProviderTest.php
index ef2fb79..0653894 100644
--- a/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/ServiceProvider/ServiceProviderTest.php
@@ -2,12 +2,12 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\ServiceProvider\ServiceProviderTest.
+ * Contains \Drupal\KernelTests\Core\ServiceProvider\ServiceProviderTest.
  */
 
-namespace Drupal\system\Tests\ServiceProvider;
+namespace Drupal\KernelTests\Core\ServiceProvider;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests service provider registration to the DIC.
@@ -21,7 +21,7 @@ class ServiceProviderTest extends KernelTestBase {
    *
    * @var array
    */
-  public static $modules = array('file', 'service_provider_test');
+  public static $modules = array('file', 'service_provider_test', 'system');
 
   /**
    * Tests that services provided by module service providers get registered to the DIC.
diff --git a/core/modules/system/src/Tests/Session/AccountSwitcherTest.php b/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php
similarity index 94%
rename from core/modules/system/src/Tests/Session/AccountSwitcherTest.php
rename to core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php
index edbf6b2..db6997a 100644
--- a/core/modules/system/src/Tests/Session/AccountSwitcherTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php
@@ -2,13 +2,13 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Session\AccountSwitcherTest.
+ * Contains \Drupal\KernelTests\Core\Session\AccountSwitcherTest.
  */
 
-namespace Drupal\system\Tests\Session;
+namespace Drupal\KernelTests\Core\Session;
 
 use Drupal\Core\Session\UserSession;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Test case for account switching.
diff --git a/core/modules/system/src/Tests/System/SettingsRewriteTest.php b/core/tests/Drupal/KernelTests/Core/Site/SettingsRewriteTest.php
similarity index 87%
rename from core/modules/system/src/Tests/System/SettingsRewriteTest.php
rename to core/tests/Drupal/KernelTests/Core/Site/SettingsRewriteTest.php
index 3e74337..f836e16 100644
--- a/core/modules/system/src/Tests/System/SettingsRewriteTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Site/SettingsRewriteTest.php
@@ -2,13 +2,13 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\System\SettingsRewriteTest.
+ * Contains \Drupal\KernelTests\Core\Site\SettingsRewriteTest.
  */
 
-namespace Drupal\system\Tests\System;
+namespace Drupal\KernelTests\Core\Site;
 
 use Drupal\Core\Site\Settings;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests the drupal_rewrite_settings() function.
@@ -16,6 +16,7 @@
  * @group system
  */
 class SettingsRewriteTest extends KernelTestBase {
+
   /**
    * Tests the drupal_rewrite_settings() function.
    */
@@ -101,9 +102,9 @@ function testDrupalRewriteSettings() {
     );
     foreach ($tests as $test) {
       $filename = Settings::get('file_public_path', $site_path . '/files') . '/mock_settings.php';
-      file_put_contents(\Drupal::root() . '/' . $filename, "<?php\n" . $test['original'] . "\n");
+      file_put_contents($filename, "<?php\n" . $test['original'] . "\n");
       drupal_rewrite_settings($test['settings'], $filename);
-      $this->assertEqual(file_get_contents(\Drupal::root() . '/' . $filename), "<?php\n" . $test['expected'] . "\n");
+      $this->assertEqual(file_get_contents($filename), "<?php\n" . $test['expected'] . "\n");
     }
 
     // Test that <?php gets added to the start of an empty settings file.
@@ -119,12 +120,12 @@ function testDrupalRewriteSettings() {
     );
     // Make an empty file.
     $filename = Settings::get('file_public_path', $site_path . '/files') . '/mock_settings.php';
-    file_put_contents(\Drupal::root() . '/' . $filename, "");
+    file_put_contents($filename, "");
 
     // Write the setting to the file.
     drupal_rewrite_settings($test['settings'], $filename);
 
     // Check that the result is just the php opening tag and the settings.
-    $this->assertEqual(file_get_contents(\Drupal::root() . '/' . $filename), "<?php\n" . $test['expected'] . "\n");
+    $this->assertEqual(file_get_contents($filename), "<?php\n" . $test['expected'] . "\n");
   }
 }
diff --git a/core/modules/system/src/Tests/Theme/ImageTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ImageTest.php
similarity index 95%
rename from core/modules/system/src/Tests/Theme/ImageTest.php
rename to core/tests/Drupal/KernelTests/Core/Theme/ImageTest.php
index d0f93df..0bf5de8 100644
--- a/core/modules/system/src/Tests/Theme/ImageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/ImageTest.php
@@ -2,12 +2,12 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Theme\ImageTest.
+ * Contains \Drupal\KernelTests\Core\Theme\ImageTest.
  */
 
-namespace Drupal\system\Tests\Theme;
+namespace Drupal\KernelTests\Core\Theme;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -38,7 +38,7 @@ protected function setUp() {
     // the Request containing the correct hostname. KernelTestBase doesn't set
     // it, so push another request onto the stack to ensure it's correct.
     $request = Request::create('/', 'GET', [], [], [], $_SERVER);
-    $this->container = $this->kernel->getContainer();
+    $this->container = \Drupal::service('kernel')->getContainer();
     $this->container->get('request_stack')->push($request);
 
     $this->testImages = array(
diff --git a/core/modules/system/src/Tests/Theme/MessageTest.php b/core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php
similarity index 84%
rename from core/modules/system/src/Tests/Theme/MessageTest.php
rename to core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php
index 878d5bc..74ad110 100644
--- a/core/modules/system/src/Tests/Theme/MessageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php
@@ -2,12 +2,12 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Theme\MessageTest.
+ * Contains \Drupal\KernelTests\Core\Theme\MessageTest.
  */
 
-namespace Drupal\system\Tests\Theme;
+namespace Drupal\KernelTests\Core\Theme;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests built-in message theme functions.
diff --git a/core/modules/system/src/Tests/Theme/RegistryTest.php b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
similarity index 98%
rename from core/modules/system/src/Tests/Theme/RegistryTest.php
rename to core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
index 92d52b4..c94a421 100644
--- a/core/modules/system/src/Tests/Theme/RegistryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
@@ -2,14 +2,14 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Theme\RegistryTest.
+ * Contains \Drupal\KernelTests\Core\Theme\RegistryTest.
  */
 
-namespace Drupal\system\Tests\Theme;
+namespace Drupal\KernelTests\Core\Theme;
 
 use Drupal\Core\Theme\Registry;
-use Drupal\simpletest\KernelTestBase;
 use Drupal\Core\Utility\ThemeRegistry;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests the behavior of the ThemeRegistry class.
diff --git a/core/modules/system/src/Tests/Theme/StableThemeTest.php b/core/tests/Drupal/KernelTests/Core/Theme/StableThemeTest.php
similarity index 92%
rename from core/modules/system/src/Tests/Theme/StableThemeTest.php
rename to core/tests/Drupal/KernelTests/Core/Theme/StableThemeTest.php
index 0df5c71..a61e81f 100644
--- a/core/modules/system/src/Tests/Theme/StableThemeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/StableThemeTest.php
@@ -2,12 +2,12 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Theme\StableThemeTest.
+ * Contains \Drupal\KernelTests\Core\Theme\StableThemeTest.
  */
 
-namespace Drupal\system\Tests\Theme;
+namespace Drupal\KernelTests\Core\Theme;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests the behavior of the Stable theme.
diff --git a/core/modules/system/src/Tests/Theme/ThemeSettingsTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php
similarity index 92%
rename from core/modules/system/src/Tests/Theme/ThemeSettingsTest.php
rename to core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php
index 3ef48d0..50ddf00 100644
--- a/core/modules/system/src/Tests/Theme/ThemeSettingsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php
@@ -2,14 +2,14 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Theme\ThemeSettingsTest.
+ * Contains \Drupal\KernelTests\Core\Theme\ThemeSettingsTest.
  */
 
-namespace Drupal\system\Tests\Theme;
+namespace Drupal\KernelTests\Core\Theme;
 
 use Drupal\Core\Config\InstallStorage;
 use Drupal\Core\Extension\ExtensionDiscovery;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests theme settings functionality.
diff --git a/core/modules/system/src/Tests/Theme/TwigEnvironmentTest.php b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php
similarity index 95%
rename from core/modules/system/src/Tests/Theme/TwigEnvironmentTest.php
rename to core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php
index 0bc52d0..cb6b54a 100644
--- a/core/modules/system/src/Tests/Theme/TwigEnvironmentTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php
@@ -2,14 +2,14 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Theme\TwigEnvironmentTest.
+ * Contains \Drupal\KernelTests\Core\Theme\TwigEnvironmentTest.
  */
 
-namespace Drupal\system\Tests\Theme;
+namespace Drupal\KernelTests\Core\Theme;
 
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Site\Settings;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests the twig environment.
@@ -52,7 +52,7 @@ public function testInlineTemplate() {
     $settings['twig_auto_reload'] = TRUE;
 
     new Settings($settings);
-    $this->container = $this->kernel->rebuildContainer();
+    $this->container = \Drupal::service('kernel')->rebuildContainer();
     \Drupal::setContainer($this->container);
 
     $element = array();
diff --git a/core/modules/system/src/Tests/Theme/TwigWhiteListTest.php b/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php
similarity index 95%
rename from core/modules/system/src/Tests/Theme/TwigWhiteListTest.php
rename to core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php
index edc0c91..7f0c2cc 100644
--- a/core/modules/system/src/Tests/Theme/TwigWhiteListTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php
@@ -1,17 +1,17 @@
 <?php
 /**
  * @file
- * Contains \Drupal\system\Tests\Theme\TwigWhiteListTest.php.
+ * Contains \Drupal\KernelTests\Core\Theme\TwigWhiteListTest.php.
  */
 
-namespace Drupal\system\Tests\Theme;
+namespace Drupal\KernelTests\Core\Theme;
 
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\KernelTests\KernelTestBase;
 use Drupal\node\Entity\Node;
 use Drupal\node\Entity\NodeType;
-use Drupal\simpletest\KernelTestBase;
 use Drupal\taxonomy\Entity\Term;
 use Drupal\taxonomy\Entity\Vocabulary;
 
diff --git a/core/modules/system/src/Tests/Validation/AllowedValuesConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php
similarity index 91%
rename from core/modules/system/src/Tests/Validation/AllowedValuesConstraintValidatorTest.php
rename to core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php
index 87c1903..f36fef5 100644
--- a/core/modules/system/src/Tests/Validation/AllowedValuesConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php
@@ -2,13 +2,13 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Validation\AllowedValuesConstraintValidatorTest.
+ * Contains \Drupal\KernelTests\Core\TypedData\AllowedValuesConstraintValidatorTest.
  */
 
-namespace Drupal\system\Tests\Validation;
+namespace Drupal\KernelTests\Core\TypedData;
 
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests AllowedValues validation constraint with both valid and invalid values.
diff --git a/core/modules/system/src/Tests/Validation/ComplexDataConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/ComplexDataConstraintValidatorTest.php
similarity index 94%
rename from core/modules/system/src/Tests/Validation/ComplexDataConstraintValidatorTest.php
rename to core/tests/Drupal/KernelTests/Core/TypedData/ComplexDataConstraintValidatorTest.php
index 5672280..67eefe8 100644
--- a/core/modules/system/src/Tests/Validation/ComplexDataConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/ComplexDataConstraintValidatorTest.php
@@ -2,14 +2,14 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Validation\ComplexDataConstraintValidatorTest.
+ * Contains \Drupal\KernelTests\Core\TypedData\ComplexDataConstraintValidatorTest.
  */
 
-namespace Drupal\system\Tests\Validation;
+namespace Drupal\KernelTests\Core\TypedData;
 
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Core\TypedData\MapDataDefinition;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests ComplexData validation constraint with both valid and invalid values
diff --git a/core/modules/system/src/Tests/TypedData/TypedDataDefinitionTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionTest.php
similarity index 96%
rename from core/modules/system/src/Tests/TypedData/TypedDataDefinitionTest.php
rename to core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionTest.php
index f534dd8..83b3474 100644
--- a/core/modules/system/src/Tests/TypedData/TypedDataDefinitionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\TypedData\TypedDataDefinitionTest.
+ * Contains \Drupal\KernelTests\Core\TypedData\TypedDataDefinitionTest.
  */
 
-namespace Drupal\system\Tests\TypedData;
+namespace Drupal\KernelTests\Core\TypedData;
 
 use Drupal\Core\TypedData\ComplexDataDefinitionInterface;
 use Drupal\Core\TypedData\DataDefinition;
@@ -15,7 +15,7 @@
 use Drupal\Core\TypedData\ListDataDefinition;
 use Drupal\Core\TypedData\ListDataDefinitionInterface;
 use Drupal\Core\TypedData\MapDataDefinition;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests deriving metadata of core data types.
diff --git a/core/modules/system/src/Tests/TypedData/TypedDataTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
similarity index 99%
rename from core/modules/system/src/Tests/TypedData/TypedDataTest.php
rename to core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
index 8c24946..99ce7f9 100644
--- a/core/modules/system/src/Tests/TypedData/TypedDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\TypedData\TypedDataTest.
+ * Contains \Drupal\KernelTests\Core\TypedData\TypedDataTest.
  */
 
-namespace Drupal\system\Tests\TypedData;
+namespace Drupal\KernelTests\Core\TypedData;
 
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\TypedData\DataDefinition;
@@ -13,8 +13,8 @@
 use Drupal\Core\TypedData\MapDataDefinition;
 use Drupal\Core\TypedData\TypedDataInterface;
 use Drupal\file\Entity\File;
-use Drupal\simpletest\KernelTestBase;
 use Drupal\Core\Datetime\DrupalDateTime;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests the functionality of all core data types.
diff --git a/core/modules/system/src/Tests/Update/CompatibilityFixTest.php b/core/tests/Drupal/KernelTests/Core/Update/CompatibilityFixTest.php
similarity index 87%
rename from core/modules/system/src/Tests/Update/CompatibilityFixTest.php
rename to core/tests/Drupal/KernelTests/Core/Update/CompatibilityFixTest.php
index 9ed5845..49942c6 100644
--- a/core/modules/system/src/Tests/Update/CompatibilityFixTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Update/CompatibilityFixTest.php
@@ -2,12 +2,12 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Update\CompatibilityFixTest.
+ * Contains \Drupal\KernelTests\Core\Update\CompatibilityFixTest.
  */
 
-namespace Drupal\system\Tests\Update;
+namespace Drupal\KernelTests\Core\Update;
 
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests that extensions that are incompatible with the current core version are disabled.
@@ -16,6 +16,11 @@
  */
 class CompatibilityFixTest extends KernelTestBase {
 
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['system'];
+
   protected function setUp() {
     parent::setUp();
     require_once \Drupal::root() . '/core/includes/update.inc';
diff --git a/core/modules/system/src/Tests/Utility/LinkGenerationTest.php b/core/tests/Drupal/KernelTests/Core/Url/LinkGenerationTest.php
similarity index 94%
rename from core/modules/system/src/Tests/Utility/LinkGenerationTest.php
rename to core/tests/Drupal/KernelTests/Core/Url/LinkGenerationTest.php
index d2d6e9a..c494517 100644
--- a/core/modules/system/src/Tests/Utility/LinkGenerationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Url/LinkGenerationTest.php
@@ -2,15 +2,15 @@
 
 /**
  * @file
- * Contains \Drupal\system\Tests\Utility\LinkGenerationTest.
+ * Contains \Drupal\KernelTests\Core\Url\LinkGenerationTest.
  */
 
-namespace Drupal\system\Tests\Utility;
+namespace Drupal\KernelTests\Core\Url;
 
 use Drupal\Component\Render\MarkupInterface;
 use Drupal\Core\Render\RenderContext;
 use Drupal\Core\Url;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 
 /**
  * Tests link generation with hooks.
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index d9aee35..858a136 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -266,18 +266,6 @@ protected function bootEnvironment() {
       $this->databasePrefix = 'simpletest' . $suffix;
     } while (is_dir($this->root . '/' . $this->siteDirectory));
 
-    $this->vfsRoot = vfsStream::setup('root', NULL, array(
-      'sites' => array(
-        'simpletest' => array(
-          $suffix => array(),
-        ),
-      ),
-    ));
-    $this->siteDirectory = vfsStream::url('root/sites/simpletest/' . $suffix);
-
-    mkdir($this->siteDirectory . '/files', 0775);
-    mkdir($this->siteDirectory . '/files/config/' . CONFIG_SYNC_DIRECTORY, 0775, TRUE);
-
     // Ensure that all code that relies on drupal_valid_test_ua() can still be
     // safely executed. This primarily affects the (test) site directory
     // resolution (used by e.g. LocalStream and PhpStorage).
@@ -293,6 +281,8 @@ protected function bootEnvironment() {
     );
     new Settings($settings);
 
+    $this->setUpFilesystem();
+
     $GLOBALS['config_directories'] = array(
       CONFIG_SYNC_DIRECTORY => $this->siteDirectory . '/files/config/sync',
     );
@@ -304,6 +294,28 @@ protected function bootEnvironment() {
   }
 
   /**
+   * Sets up the filesystem, so things like the file directory.
+   */
+  protected function setUpFilesystem() {
+    $suffix = str_replace('simpletest', '', $this->databasePrefix);
+    $this->vfsRoot = vfsStream::setup('root', NULL, array(
+      'sites' => array(
+        'simpletest' => array(
+          $suffix => array(),
+        ),
+      ),
+    ));
+    $this->siteDirectory = vfsStream::url('root/sites/simpletest/' . $suffix);
+
+    mkdir($this->siteDirectory . '/files', 0775);
+    mkdir($this->siteDirectory . '/files/config/' . CONFIG_SYNC_DIRECTORY, 0775, TRUE);
+
+    $settings = Settings::getAll();
+    $settings['file_public_path'] = $this->siteDirectory . '/files';
+    new Settings($settings);
+  }
+
+  /**
    * @return string
    */
   public function getDatabasePrefix() {
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
index 70d01ec..64c7ae4 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
@@ -116,14 +116,14 @@ public function testNonExistentDerivativeFetcher() {
    * @see \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator::getDeriver().\
    *
    * @expectedException \Drupal\Component\Plugin\Exception\InvalidDeriverException
-   * @expectedExceptionMessage Plugin (invalid_discovery) deriver "\Drupal\system\Tests\Plugin\DerivativeTest" must implement \Drupal\Component\Plugin\Derivative\DeriverInterface.
+   * @expectedExceptionMessage Plugin (invalid_discovery) deriver "\Drupal\KernelTests\Core\Plugin\DerivativeTest" must implement \Drupal\Component\Plugin\Derivative\DeriverInterface.
    */
   public function testInvalidDerivativeFetcher() {
     $definitions = array();
     // Do this with a class that doesn't implement the interface.
     $definitions['invalid_discovery'] = array(
       'id' => 'invalid_discovery',
-      'deriver' => '\Drupal\system\Tests\Plugin\DerivativeTest',
+      'deriver' => '\Drupal\KernelTests\Core\Plugin\DerivativeTest',
     );
     $this->discoveryMain->expects($this->any())
       ->method('getDefinitions')
