diff --git a/core/tests/Drupal/Tests/UnitTestCase.php b/core/tests/Drupal/Tests/UnitTestCase.php
index c15bff2..53ee28e 100644
--- a/core/tests/Drupal/Tests/UnitTestCase.php
+++ b/core/tests/Drupal/Tests/UnitTestCase.php
@@ -42,6 +42,11 @@ protected function setUp() {
     \Drupal::unsetContainer();
 
     $this->root = dirname(dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))));
+
+    // Ensure that tests are in the Drupal\Tests namespace.
+    if (__NAMESPACE__ != 'Drupal\Tests' || strpos(__NAMESPACE__, 'Drupal\Tests\\', 0) !== 0) {
+      throw new \Exception('Unit tests must be in the "Drupal\Tests" namespace.');
+    }
   }
 
   /**
diff --git a/core/tests/Drupal/UnitTestCaseTest/UnitTestCaseTest.php b/core/tests/Drupal/UnitTestCaseTest/UnitTestCaseTest.php
new file mode 100644
index 0000000..b1d9a4f
--- /dev/null
+++ b/core/tests/Drupal/UnitTestCaseTest/UnitTestCaseTest.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\UnitTestCaseTest\UnitTestCaseTest.
+ */
+
+// Note: this test is in an "invalid" namespace on purpose.
+// All tests ought to be in "Drupal\Tests".
+namespace Drupal\UnitTestCaseTest;
+
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * Provides a test for the namespace enforcement in UnitTestCase::setUp().
+ *
+ * @coversDefaultClass \Drupal\Tests\UnitTestCase
+ * @group simpletest
+ */
+class UnitTestCaseTest extends UnitTestCase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    // Do nothing, as running parent::setUp() will throw an exception.
+  }
+
+  /**
+   * @covers ::setUp
+   *
+   * @expectedException        Exception
+   * @expectedExceptionMessage Unit tests must be in the "Drupal\Tests" namespace.
+   */
+  public function testSetUp() {
+    // This should throw the exception listed in the annotation.
+    parent::setUp();
+  }
+
+}
diff --git a/core/tests/bootstrap.php b/core/tests/bootstrap.php
index d0512e1..64eb64f 100644
--- a/core/tests/bootstrap.php
+++ b/core/tests/bootstrap.php
@@ -70,6 +70,7 @@ function drupal_phpunit_register_extension_dirs(Composer\Autoload\ClassLoader $l
 // Start with classes in known locations.
 $loader = require __DIR__ . '/../../autoload.php';
 $loader->add('Drupal\\Tests', __DIR__);
+$loader->add('Drupal\\UnitTestCaseTest', __DIR__);
 
 // Scan for arbitrary extension namespaces from core and contrib.
 $extension_roots = array_merge(array(
