diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 5300d76..3e8f033 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -1123,3 +1123,38 @@ function _drupal_shutdown_function_handle_exception($exception) {
   }
   error_log($exception);
 }
+
+/**
+ * Registers the assertion handle.
+ *
+ * This assertion handle unifies assertion handling for PHP 5 and PHP 7.
+ */
+function drupal_register_assert_handle() {
+  if (!assert_options(ASSERT_ACTIVE)) {
+    return;
+  }
+
+  // In PHP 7, we just make sure assert failures are thrown as exceptions.
+  if (version_compare(PHP_VERSION, '7.0.0-dev') >= 0) {
+    assert_options(ASSERT_EXCEPTION, 1);
+  }
+  // In PHP 5, we establish an assert callback handle that will throw AssertionErrors.
+  elseif (assert_options(ASSERT_CALLBACK) === NULL) {
+    class AssertionError extends Exception {
+      public function __construct($message, $code = 0, Exception $previous = NULL, $file, $line) {
+        parent::__construct($message, $code, $previous);
+        // Preserve the filename and line number of the assertion failure.
+        $this->file = $file;
+        $this->line = $line;
+      }
+    }
+
+    assert_options(ASSERT_CALLBACK, function($file, $line, $code, $message = '') {
+      // Use the same message as PHP 7 AssertionErrors.
+      if (empty($message)) {
+        $message = $code;
+      }
+      throw new AssertionError($message, 0, NULL, $file, $line);
+    });
+  }
+}
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index e3afc1f..4b6dbb1 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -862,6 +862,10 @@ public static function bootEnvironment() {
         // Simpletest's internal browser.
         define('DRUPAL_TEST_IN_CHILD_SITE', TRUE);
 
+        // Enable runtime assertions.
+        assert_options(ASSERT_ACTIVE, 1);
+        drupal_register_assert_handle();
+
         // Log fatal errors to the test site directory.
         ini_set('log_errors', 1);
         ini_set('error_log', DRUPAL_ROOT . '/sites/simpletest/' . substr($test_prefix, 10) . '/error.log');
diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php
index 1f97845..8afaa75 100644
--- a/core/modules/simpletest/src/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php
@@ -164,7 +164,24 @@ function stubTest() {
     $site_path = $this->container->get('site.path');
     file_put_contents($key_file, $private_key);
 
-    // This causes the first of the fifteen passes asserted in
+    // Check to see if runtime assertions are indeed on, if successful this
+    // will be the first of sixteen passes asserted in confirmStubResults()
+    try {
+      assert(FALSE);
+      $this->fail('Runtime assertions are not working.');
+    } catch (\AssertionError $e) {
+      $this->pass('Runtime assertions enabled and running.');
+      $this->assertEqual($e->getMessage, 'FALSE');
+    }
+
+    // Check to see that assertion messsages get passed along.
+    try {
+      assert(FALSE, 'Success!');
+    } catch (\AssertionError $e) {
+      $this->assertEqual($e->getMessage, 'Success!');
+    }
+
+    // This causes the second of the sixteen passes asserted in
     // confirmStubResults().
     $this->pass($this->passMessage);
 
@@ -175,7 +192,7 @@ function stubTest() {
     // confirmStubResults().
     $this->fail($this->failMessage);
 
-    // This causes the second to fourth of the fifteen passes asserted in
+    // This causes the third to fifth of the sixteen passes asserted in
     // confirmStubResults().
     $user = $this->drupalCreateUser(array($this->validPermission), 'SimpleTestTest');
 
@@ -183,15 +200,15 @@ function stubTest() {
     $this->drupalCreateUser(array($this->invalidPermission));
 
     // Test logging in as a user.
-    // This causes the fifth to ninth of the fifteen passes asserted in
+    // This causes the sixth to tenth of the sixteen passes asserted in
     // confirmStubResults().
     $this->drupalLogin($user);
 
-    // This causes the tenth of the fifteen passes asserted in
+    // This causes the twelfth of the sixteen passes asserted in
     // confirmStubResults().
     $this->pass(t('Test ID is @id.', array('@id' => $this->testId)));
 
-    // These cause the eleventh to fourteenth of the fifteen passes asserted in
+    // These cause the thirteenth to fifteenth of the sixteen passes asserted in
     // confirmStubResults().
     $this->assertTrue(file_exists($site_path . '/settings.testing.php'));
     // Check the settings.testing.php file got included.
@@ -206,7 +223,7 @@ function stubTest() {
     // Generates a warning inside a PHP function.
     array_key_exists(NULL, NULL);
 
-    // This causes the fifteenth of the fifteen passes asserted in
+    // This causes the sixteenth of the sixteen passes asserted in
     // confirmStubResults().
     $this->assertNothing();
 
@@ -250,7 +267,7 @@ function confirmStubTestResults() {
 
     $this->assertAssertion("Debug: 'Foo'", 'Debug', 'Fail', 'SimpleTestTest.php', 'Drupal\simpletest\Tests\SimpleTestTest->stubTest()');
 
-    $this->assertEqual('15 passes, 3 fails, 2 exceptions, 3 debug messages', $this->childTestResults['summary']);
+    $this->assertEqual('16 passes, 3 fails, 2 exceptions, 3 debug messages', $this->childTestResults['summary']);
 
     $this->testIds[] = $test_id = $this->getTestIdFromResults();
     $this->assertTrue($test_id, 'Found test ID in results.');
diff --git a/core/tests/bootstrap.php b/core/tests/bootstrap.php
index fd980a4..e453309 100644
--- a/core/tests/bootstrap.php
+++ b/core/tests/bootstrap.php
@@ -89,3 +89,7 @@ function drupal_phpunit_register_extension_dirs(Composer\Autoload\ClassLoader $l
 // Set the default timezone. While this doesn't cause any tests to fail, PHP
 // complains if 'date.timezone' is not set in php.ini.
 date_default_timezone_set('UTC');
+
+// Register the assertion handle.
+require_once __DIR__ . '/../includes/bootstrap.inc';
+drupal_register_assert_handle();
