diff --git a/core/modules/system/src/Tests/Database/DatabaseWebTestBase.php b/core/modules/system/src/Tests/Database/DatabaseWebTestBase.php
index 8fb369a376..8a250baf35 100644
--- a/core/modules/system/src/Tests/Database/DatabaseWebTestBase.php
+++ b/core/modules/system/src/Tests/Database/DatabaseWebTestBase.php
@@ -2,11 +2,16 @@
 
 namespace Drupal\system\Tests\Database;
 
+@trigger_error(__NAMESPACE__ . '\DatabaseWebTestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\system\Functional\Database\DatabaseTestBase', E_USER_DEPRECATED);
+
 use Drupal\KernelTests\Core\Database\DatabaseTestBase;
 use Drupal\simpletest\WebTestBase;
 
 /**
  * Base class for databases database tests.
+ *
+ * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead
+ *   use \Drupal\Tests\system\Functional\Database\DatabaseTestBase.
  */
 abstract class DatabaseWebTestBase extends WebTestBase {
 
diff --git a/core/modules/system/src/Tests/Database/FakeRecord.php b/core/modules/system/src/Tests/Database/FakeRecord.php
index fce136684e..cd7486cc73 100644
--- a/core/modules/system/src/Tests/Database/FakeRecord.php
+++ b/core/modules/system/src/Tests/Database/FakeRecord.php
@@ -2,11 +2,16 @@
 
 namespace Drupal\system\Tests\Database;
 
+@trigger_error(__NAMESPACE__ . '\FakeRecord is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\system\Functional\Database\FakeRecord', E_USER_DEPRECATED);
+
 /**
  * Fetches into a class.
  *
  * PDO supports using a new instance of an arbitrary class for records
  * rather than just a stdClass or array. This class is for testing that
  * functionality. (See testQueryFetchClass() below)
+ *
+ * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead
+ *   use \Drupal\Tests\system\Functional\Database\FakeRecord.
  */
 class FakeRecord { }
diff --git a/core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php b/core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php
new file mode 100644
index 0000000000..a28c1dba23
--- /dev/null
+++ b/core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Drupal\Tests\system\Functional\Database;
+
+use Drupal\KernelTests\Core\Database\DatabaseTestBase as DatabaseKernelTestBase;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Base class for databases database tests.
+ */
+abstract class DatabaseTestBase extends BrowserTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['database_test'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    DatabaseKernelTestBase::addSampleData();
+  }
+
+}
diff --git a/core/modules/system/src/Tests/Database/FakeRecord.php b/core/modules/system/tests/src/Functional/Database/FakeRecord.php
similarity index 77%
copy from core/modules/system/src/Tests/Database/FakeRecord.php
copy to core/modules/system/tests/src/Functional/Database/FakeRecord.php
index fce136684e..aa3a5fe35b 100644
--- a/core/modules/system/src/Tests/Database/FakeRecord.php
+++ b/core/modules/system/tests/src/Functional/Database/FakeRecord.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Database;
+namespace Drupal\Tests\system\Functional\Database;
 
 /**
  * Fetches into a class.
@@ -9,4 +9,4 @@
  * rather than just a stdClass or array. This class is for testing that
  * functionality. (See testQueryFetchClass() below)
  */
-class FakeRecord { }
+class FakeRecord {}
diff --git a/core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php b/core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php
similarity index 89%
rename from core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php
rename to core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php
index a264d33ea6..63e7e31637 100644
--- a/core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php
+++ b/core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php
@@ -1,6 +1,7 @@
 <?php
 
-namespace Drupal\system\Tests\Database;
+namespace Drupal\Tests\system\Functional\Database;
+
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -8,7 +9,7 @@
  *
  * @group Database
  */
-class SelectPagerDefaultTest extends DatabaseWebTestBase {
+class SelectPagerDefaultTest extends DatabaseTestBase {
 
   /**
    * Confirms that a pager query returns the correct results.
@@ -34,13 +35,13 @@ public function testEvenPagerQuery() {
 
     for ($page = 0; $page <= $num_pages; ++$page) {
       $this->drupalGet('database_test/pager_query_even/' . $limit, ['query' => ['page' => $page]]);
-      $data = json_decode($this->getRawContent());
+      $data = json_decode($this->getSession()->getPage()->getContent());
 
       if ($page == $num_pages) {
         $correct_number = $count - ($limit * $page);
       }
 
-      $this->assertEqual(count($data->names), $correct_number, format_string('Correct number of records returned by pager: @number', ['@number' => $correct_number]));
+      $this->assertCount($correct_number, $data->names, format_string('Correct number of records returned by pager: @number', ['@number' => $correct_number]));
     }
   }
 
@@ -68,13 +69,13 @@ public function testOddPagerQuery() {
 
     for ($page = 0; $page <= $num_pages; ++$page) {
       $this->drupalGet('database_test/pager_query_odd/' . $limit, ['query' => ['page' => $page]]);
-      $data = json_decode($this->getRawContent());
+      $data = json_decode($this->getSession()->getPage()->getContent());
 
       if ($page == $num_pages) {
         $correct_number = $count - ($limit * $page);
       }
 
-      $this->assertEqual(count($data->names), $correct_number, format_string('Correct number of records returned by pager: @number', ['@number' => $correct_number]));
+      $this->assertCount($correct_number, $data->names, format_string('Correct number of records returned by pager: @number', ['@number' => $correct_number]));
     }
   }
 
diff --git a/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php b/core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php
similarity index 85%
rename from core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php
rename to core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php
index 97a676b162..2904d31fa6 100644
--- a/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php
+++ b/core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php
@@ -1,13 +1,13 @@
 <?php
 
-namespace Drupal\system\Tests\Database;
+namespace Drupal\Tests\system\Functional\Database;
 
 /**
  * Tests the tablesort query extender.
  *
  * @group Database
  */
-class SelectTableSortDefaultTest extends DatabaseWebTestBase {
+class SelectTableSortDefaultTest extends DatabaseTestBase {
 
   /**
    * Confirms that a tablesort query returns the correct results.
@@ -27,7 +27,7 @@ public function testTableSortQuery() {
 
     foreach ($sorts as $sort) {
       $this->drupalGet('database_test/tablesort/', ['query' => ['order' => $sort['field'], 'sort' => $sort['sort']]]);
-      $data = json_decode($this->getRawContent());
+      $data = json_decode($this->getSession()->getPage()->getContent());
 
       $first = array_shift($data->tasks);
       $last = array_pop($data->tasks);
@@ -55,7 +55,7 @@ public function testTableSortQueryFirst() {
 
     foreach ($sorts as $sort) {
       $this->drupalGet('database_test/tablesort_first/', ['query' => ['order' => $sort['field'], 'sort' => $sort['sort']]]);
-      $data = json_decode($this->getRawContent());
+      $data = json_decode($this->getSession()->getPage()->getContent());
 
       $first = array_shift($data->tasks);
       $last = array_pop($data->tasks);
@@ -72,16 +72,18 @@ public function testTableSortQueryFirst() {
    * are correct.
    */
   public function testTableSortDefaultSort() {
+    $assert = $this->assertSession();
+
     $this->drupalGet('database_test/tablesort_default_sort');
 
     // Verify that the table was displayed. Just the header is checked for
     // because if there were any fatal errors or exceptions in displaying the
     // sorted table, it would not print the table.
-    $this->assertText(t('Username'));
+    $assert->pageTextContains(t('Username'));
 
     // Verify that the header links are built properly.
-    $this->assertLinkByHref('database_test/tablesort_default_sort');
-    $this->assertPattern('/\<a.*title\=\"' . t('sort by Username') . '\".*\>/');
+    $assert->linkByHrefExists('database_test/tablesort_default_sort');
+    $assert->responseMatches('/\<a.*title\=\"' . t('sort by Username') . '\".*\>/');
   }
 
 }
diff --git a/core/modules/system/src/Tests/Database/TemporaryQueryTest.php b/core/modules/system/tests/src/Functional/Database/TemporaryQueryTest.php
similarity index 90%
rename from core/modules/system/src/Tests/Database/TemporaryQueryTest.php
rename to core/modules/system/tests/src/Functional/Database/TemporaryQueryTest.php
index d0dce74e46..5226585790 100644
--- a/core/modules/system/src/Tests/Database/TemporaryQueryTest.php
+++ b/core/modules/system/tests/src/Functional/Database/TemporaryQueryTest.php
@@ -1,18 +1,16 @@
 <?php
 
-namespace Drupal\system\Tests\Database;
+namespace Drupal\Tests\system\Functional\Database;
 
 /**
  * Tests the temporary query functionality.
  *
  * @group Database
  */
-class TemporaryQueryTest extends DatabaseWebTestBase {
+class TemporaryQueryTest extends DatabaseTestBase {
 
   /**
-   * Modules to enable.
-   *
-   * @var array
+   * {@inheritdoc}
    */
   public static $modules = ['database_test'];
 
@@ -28,7 +26,7 @@ public function countTableRows($table_name) {
    */
   public function testTemporaryQuery() {
     $this->drupalGet('database_test/db_query_temporary');
-    $data = json_decode($this->getRawContent());
+    $data = json_decode($this->getSession()->getPage()->getContent());
     if ($data) {
       $this->assertEqual($this->countTableRows('test'), $data->row_count, 'The temporary table contains the correct amount of rows.');
       $this->assertFalse(db_table_exists($data->table_name), 'The temporary table is, indeed, temporary.');
diff --git a/core/modules/system/src/Tests/DrupalKernel/ContainerRebuildWebTest.php b/core/modules/system/tests/src/Functional/DrupalKernel/ContainerRebuildWebTest.php
similarity index 63%
rename from core/modules/system/src/Tests/DrupalKernel/ContainerRebuildWebTest.php
rename to core/modules/system/tests/src/Functional/DrupalKernel/ContainerRebuildWebTest.php
index c87e3ad8eb..828b92f289 100644
--- a/core/modules/system/src/Tests/DrupalKernel/ContainerRebuildWebTest.php
+++ b/core/modules/system/tests/src/Functional/DrupalKernel/ContainerRebuildWebTest.php
@@ -1,15 +1,15 @@
 <?php
 
-namespace Drupal\system\Tests\DrupalKernel;
+namespace Drupal\Tests\system\Functional\DrupalKernel;
 
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Ensures that the container rebuild works as expected.
  *
  * @group DrupalKernel
  */
-class ContainerRebuildWebTest extends WebTestBase {
+class ContainerRebuildWebTest extends BrowserTestBase {
 
   /**
    * {@inheritdoc}
@@ -20,36 +20,40 @@ class ContainerRebuildWebTest extends WebTestBase {
    * Sets a different deployment identifier.
    */
   public function testSetContainerRebuildWithDifferentDeploymentIdentifier() {
+    $assert = $this->assertSession();
+
+    // Ensure the parameter is not set.
     $this->drupalGet('<front>');
-    $this->assertHeader('container_rebuild_indicator', FALSE);
+    $assert->responseHeaderEquals('container_rebuild_indicator', NULL);
 
     $this->writeSettings(['settings' => ['deployment_identifier' => (object) ['value' => 'new-identifier', 'required' => TRUE]]]);
 
     $this->drupalGet('<front>');
 
-    $this->assertHeader('container_rebuild_indicator', 'new-identifier');
+    $assert->responseHeaderEquals('container_rebuild_indicator', 'new-identifier');
   }
 
   /**
    * Tests container invalidation.
    */
   public function testContainerInvalidation() {
+    $assert = $this->assertSession();
 
     // Ensure that parameter is not set.
     $this->drupalGet('<front>');
-    $this->assertHeader('container_rebuild_test_parameter', FALSE);
+    $assert->responseHeaderEquals('container_rebuild_test_parameter', NULL);
 
     // Ensure that after setting the parameter, without a container rebuild the
     // parameter is still not set.
     $this->writeSettings(['settings' => ['container_rebuild_test_parameter' => (object) ['value' => 'rebuild_me_please', 'required' => TRUE]]]);
 
     $this->drupalGet('<front>');
-    $this->assertHeader('container_rebuild_test_parameter', FALSE);
+    $assert->responseHeaderEquals('container_rebuild_test_parameter', NULL);
 
     // Ensure that after container invalidation the parameter is set.
     \Drupal::service('kernel')->invalidateContainer();
     $this->drupalGet('<front>');
-    $this->assertHeader('container_rebuild_test_parameter', 'rebuild_me_please');
+    $assert->responseHeaderEquals('container_rebuild_test_parameter', 'rebuild_me_please');
   }
 
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php b/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php
index e55590e7ed..d0439c5f10 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php
@@ -4,7 +4,7 @@
 
 use Drupal\Core\Database\RowCountException;
 use Drupal\Core\Database\StatementInterface;
-use Drupal\system\Tests\Database\FakeRecord;
+use Drupal\Tests\system\Functional\Database\FakeRecord;
 
 /**
  * Tests the Database system's various fetch capabilities.
@@ -69,7 +69,7 @@ public function testQueryFetchArray() {
    */
   public function testQueryFetchClass() {
     $records = [];
-    $result = db_query('SELECT name FROM {test} WHERE age = :age', [':age' => 25], ['fetch' => 'Drupal\system\Tests\Database\FakeRecord']);
+    $result = db_query('SELECT name FROM {test} WHERE age = :age', [':age' => 25], ['fetch' => FakeRecord::class]);
     foreach ($result as $record) {
       $records[] = $record;
       if ($this->assertTrue($record instanceof FakeRecord, 'Record is an object of class FakeRecord.')) {
