diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
index 350fcbc..39e5333 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
@@ -130,12 +130,12 @@ protected function setUp() {
     $this->prepareConfigDirectories();
 
     // Build a minimal, partially mocked environment for unit tests.
-    $this->containerBuild(\Drupal::getContainer());
+    $this->containerBuild(new ContainerBuilder());
     // Make sure it survives kernel rebuilds.
     $GLOBALS['conf']['container_service_providers']['TestServiceProvider'] = 'Drupal\simpletest\TestServiceProvider';
 
-    \Drupal::state()->set('system.module.files', $this->moduleFiles);
-    \Drupal::state()->set('system.theme.files', $this->themeFiles);
+    $this->container->get('state')->set('system.module.files', $this->moduleFiles);
+    $this->container->get('state')->set('system.theme.files', $this->themeFiles);
 
     // Bootstrap the kernel.
     // No need to dump it; this test runs in-memory.
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/InstallerTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/InstallerTestBase.php
index 899c7d8..d4b9992 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/InstallerTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/InstallerTestBase.php
@@ -7,7 +7,11 @@
 
 namespace Drupal\simpletest;
 
+use Drupal\Core\Language\Language;
 use Drupal\Core\Session\UserSession;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Reference;
+use Symfony\Component\HttpFoundation\Request;
 
 /**
  * Base class for testing the interactive installer.
@@ -91,6 +95,25 @@ protected function setUp() {
     // @see WebTestBase::translatePostValues()
     $this->parameters = $this->installParameters();
 
+    // Set up a minimal container (required by WebTestBase).
+    // @see install_begin_request()
+    $request = Request::create($GLOBALS['base_url'] . '/core/install.php');
+    $this->container = new ContainerBuilder();
+    $this->container
+      ->set('request', $request);
+    $this->container
+      ->setParameter('language.default_values', Language::$defaultValues);
+    $this->container
+      ->register('language.default', 'Drupal\Core\Language\LanguageDefault')
+      ->addArgument('%language.default_values%');
+    $this->container
+      ->register('language_manager', 'Drupal\Core\Language\LanguageManager')
+      ->addArgument(new Reference('language.default'));
+    $this->container
+      ->register('string_translation', 'Drupal\Core\StringTranslation\TranslationManager')
+      ->addArgument(new Reference('language_manager'));
+    \Drupal::setContainer($this->container);
+
     $this->drupalGet($GLOBALS['base_url'] . '/core/install.php');
 
     // Select language.
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index 1579e4e..cd82fd3 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -1068,28 +1068,8 @@ private function prepareEnvironment() {
     drupal_static_reset();
 
     // Reset and create a new service container.
-    $this->container = new ContainerBuilder();
-
-    // @todo Remove this once this class has no calls to t() and format_plural()
-    $this->container->setParameter('language.default_values', Language::$defaultValues);
-    $this->container->register('language.default', 'Drupal\Core\Language\LanguageDefault')
-      ->addArgument('%language.default_values%');
-    $this->container->register('language_manager', 'Drupal\Core\Language\LanguageManager')
-      ->addArgument(new Reference('language.default'));
-    $this->container->register('string_translation', 'Drupal\Core\StringTranslation\TranslationManager')
-      ->addArgument(new Reference('language_manager'));
-
-    // Register info parser.
-    $this->container->register('info_parser', 'Drupal\Core\Extension\InfoParser');
-
-    $request = Request::create('/');
-    $this->container->set('request', $request);
-
-    // Run all tests as a anonymous user by default, web tests will replace that
-    // during the test set up.
-    $this->container->set('current_user', new AnonymousUserSession());
-
-    \Drupal::setContainer($this->container);
+    $this->container = NULL;
+    \Drupal::setContainer(NULL);
 
     // Unset globals.
     unset($GLOBALS['config_directories']);
@@ -1196,7 +1176,7 @@ private function restoreEnvironment() {
     // which means they may need to access its filesystem and database.
     drupal_static_reset();
 
-    if ($this->container->has('state') && $state = $this->container->get('state')) {
+    if ($this->container && $this->container->has('state') && $state = $this->container->get('state')) {
       $captured_emails = $state->get('system.test_mail_collector') ?: array();
       $emailCount = count($captured_emails);
       if ($emailCount) {
@@ -1275,7 +1255,7 @@ private function restoreEnvironment() {
     $callbacks = $this->originalShutdownCallbacks;
 
     // Restore original user session.
-    $this->container->set('current_user', $this->originalUser);
+    \Drupal::getContainer()->set('current_user', $this->originalUser);
     \Drupal::service('session_manager')->enable();
   }
 
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/MissingDependentModuleUnitTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/MissingDependentModuleUnitTest.php
index 08874bd..1420c28 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/MissingDependentModuleUnitTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/MissingDependentModuleUnitTest.php
@@ -26,6 +26,6 @@ public static function getInfo() {
    * Ensure that this test will not be loaded despite its dependency.
    */
   function testFail() {
-    $this->fail(t('Running test with missing required module.'));
+    $this->fail('Running test with missing required module.');
   }
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/HtmlIdentifierUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/HtmlIdentifierUnitTest.php
index ec9bbb4..3d076ce 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/HtmlIdentifierUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/HtmlIdentifierUnitTest.php
@@ -7,13 +7,12 @@
 
 namespace Drupal\system\Tests\Common;
 
-use Drupal\simpletest\UnitTestBase;
-use Symfony\Component\HttpFoundation\Request;
+use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
  * Tests cleaning HTML identifiers.
  */
-class HtmlIdentifierUnitTest extends UnitTestBase {
+class HtmlIdentifierUnitTest extends DrupalUnitTestBase {
   public static function getInfo() {
     return array(
       'name' => 'HTML identifiers',
@@ -23,18 +22,6 @@ public static function getInfo() {
   }
 
   /**
-   * {@inheritdoc}
-   */
-  public function setUp() {
-    parent::setUp();
-
-    $container = \Drupal::getContainer();
-    $request = new Request();
-    $container->set('request', $request);
-    \Drupal::setContainer($container);
-  }
-
-  /**
    * Tests that drupal_clean_css_identifier() cleans the identifier properly.
    */
   function testDrupalCleanCSSIdentifier() {
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/SizeUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/SizeUnitTest.php
index a8a2662..1a92d70 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/SizeUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/SizeUnitTest.php
@@ -7,12 +7,12 @@
 
 namespace Drupal\system\Tests\Common;
 
-use Drupal\simpletest\UnitTestBase;
+use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
  * Tests file size parsing and formatting functions.
  */
-class SizeUnitTest extends UnitTestBase {
+class SizeUnitTest extends DrupalUnitTestBase {
   protected $exact_test_cases;
   protected $rounded_test_cases;
 
@@ -25,6 +25,7 @@ public static function getInfo() {
   }
 
   function setUp() {
+    parent::setUp();
     $kb = DRUPAL_KILOBYTE;
     $this->exact_test_cases = array(
       '1 byte' => 1,
@@ -44,7 +45,6 @@ function setUp() {
       round(67234178751368124 / ($this->exact_test_cases['1 PB']), 2) . ' PB' => 67234178751368124, // petabytes
       round(235346823821125814962843827 / ($this->exact_test_cases['1 YB']), 2) . ' YB' => 235346823821125814962843827, // yottabytes
     );
-    parent::setUp();
   }
 
   /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php
index 59eca4a..436b8a1 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php
@@ -7,13 +7,13 @@
 
 namespace Drupal\system\Tests\Common;
 
-use Drupal\simpletest\UnitTestBase;
+use Drupal\simpletest\DrupalUnitTestBase;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
  * Tests unicode handling features implemented in unicode.inc.
  */
-class TableSortExtenderUnitTest extends UnitTestBase {
+class TableSortExtenderUnitTest extends DrupalUnitTestBase {
 
   public static function getInfo() {
     return array(
diff --git a/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/DiscoveryTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/DiscoveryTestBase.php
index 20a574a..ea02491 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/DiscoveryTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/DiscoveryTestBase.php
@@ -7,12 +7,12 @@
 
 namespace Drupal\system\Tests\Plugin\Discovery;
 
-use Drupal\simpletest\UnitTestBase;
+use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
  * Tests that plugins are correctly discovered.
  */
-class DiscoveryTestBase extends UnitTestBase {
+class DiscoveryTestBase extends DrupalUnitTestBase {
 
   /**
    * The discovery component to test.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Plugin/PluginTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/PluginTestBase.php
index 3a92dbd..fdb4b2d 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Plugin/PluginTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/PluginTestBase.php
@@ -7,7 +7,7 @@
 
 namespace Drupal\system\Tests\Plugin;
 
-use Drupal\simpletest\UnitTestBase;
+use Drupal\simpletest\DrupalUnitTestBase;
 use Drupal\plugin_test\Plugin\TestPluginManager;
 use Drupal\plugin_test\Plugin\MockBlockManager;
 use Drupal\plugin_test\Plugin\DefaultsTestPluginManager;
@@ -17,7 +17,15 @@
 /**
  * Base class for Plugin API unit tests.
  */
-abstract class PluginTestBase extends UnitTestBase {
+abstract class PluginTestBase extends DrupalUnitTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('plugin_test');
+
   protected $testPluginManager;
   protected $testPluginExpectedDefinitions;
   protected $mockBlockManager;
