diff --git a/.htaccess b/.htaccess
index af418c4..d308dd8 100644
--- a/.htaccess
+++ b/.htaccess
@@ -28,13 +28,28 @@ DirectoryIndex index.php index.html index.htm
 AddType image/svg+xml svg svgz
 AddEncoding gzip svgz
 
-# Override PHP settings that cannot be changed at runtime. See
-# sites/default/default.settings.php and
-# Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be
-# changed at runtime.
-
 # PHP 5, Apache 1 and 2.
 <IfModule mod_php5.c>
+  # PHP enables assert statements by default. Drupal uses them to perform
+  # validations that are only necessary during module and theme development,
+  # and that slow the system down. Hence the Drupal default is off.
+  php_value assert.active                   0
+
+  # Assert statements are used to validate the cache. To prevent invalid cache
+  # entries from being written during development you need to turn assert bail
+  # on. You need to do this even if you disabled caching as Drupal writes caches
+  # even when it isn't reading from them.
+  php_value assert.bail                     0
+
+  # The above two settings can be changed at runtime using assert_options()
+  # Set them here to enable assert statements before
+  # Drupal\Core\DrupalKernel::bootEnvironment() runs.
+  # See sites/example.settings.local.php
+  #
+  # Override PHP settings that cannot be changed at runtime. See
+  # sites/default/default.settings.php and
+  # Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be
+  # changed at runtime.
   php_flag session.auto_start               off
   php_value mbstring.http_input             pass
   php_value mbstring.http_output            pass
diff --git a/core/lib/Drupal/Component/Assertion/Assertion.php b/core/lib/Drupal/Component/Assertion/Assertion.php
new file mode 100644
index 0000000..91b4912
--- /dev/null
+++ b/core/lib/Drupal/Component/Assertion/Assertion.php
@@ -0,0 +1,122 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\Component\Assertion\Assertion.
+ */
+
+namespace Drupal\Component\Assertion;
+
+use Traversable;
+
+/**
+ * Collection of methods to assist the assert statement.
+ *
+ * This is a static function collection for use by the assert statement on the
+ * more complicated assertions we wish to make which are of use to the general
+ * PHP community. Complicated assertions that deal with Drupal's idiosyncrasies
+ * should be attached to the relevant class.
+ */
+class Assertion {
+
+  /**
+   * Tests a collection to insure all members share the stated property.
+   *
+   * Example call:
+   * @code
+   *   assert('Drupal\\Component\\Assertion::allMembersAre(\'string\', $array');
+   * @endcode
+   *
+   * @param string $property
+   *   Property to test for one of:
+   *    - Class or interface.
+   *    - Primitive type such as string or integer.
+   *    - Status, such as not being empty, callable, or castable to string.
+   * @param array|Traversable $traversable
+   *   An array or traversable object.
+   *
+   * @return bool
+   */
+  public static function allMembersAre($property, $traversable) {
+    if (!(is_array($traversable) || (is_object($traversable) && $traversable instanceof Traversable))) {
+      return FALSE;
+    }
+
+    foreach ($traversable as $obj) {
+      switch ($property) {
+        case 'array':
+          if (!is_array($obj)) {
+            return FALSE;
+          }
+          break;
+
+        case 'string':
+          if (!is_string($obj)) {
+            return FALSE;
+          }
+          break;
+
+        // As above but allows objects which implment __toString(). Unless
+        // you have a specific reason to test for strings specifically (Such
+        // as testing for valid array key values), use this instead.
+        case 'stringable':
+          if (!(is_string($obj) || (is_object($obj) && method_exists($obj, '__toString')))) {
+            return FALSE;
+          }
+          break;
+
+        case 'int':
+        case 'integer':
+        case 'long':
+          if (!is_int($obj)) {
+            return FALSE;
+          }
+          break;
+
+        case 'double':
+        case 'float':
+        case 'real':
+          if (!is_float($obj)) {
+            return FALSE;
+          }
+          break;
+
+        case 'callable':
+          if (!is_callable($obj)) {
+            return FALSE;
+          }
+          break;
+
+        case 'not-empty':
+          if (empty($obj)) {
+            return FALSE;
+          }
+          break;
+
+        // Reminder - is_numeric() returns true on strings with a value that
+        // can be parsed into a number.
+        case 'numeric':
+          if (!is_numeric($obj)) {
+            return FALSE;
+          }
+          break;
+
+        // Use this sparingly if at all, it's usually best to call for a
+        // specific object class or interface.
+        case 'object':
+          if (!is_object($obj)) {
+            return FALSE;
+          }
+          break;
+
+        default:
+          if (!$obj instanceof $property) {
+            return FALSE;
+          }
+          break;
+      }
+    }
+
+    return TRUE;
+  }
+
+}
diff --git a/core/lib/Drupal/Component/Assertion/AssertionException.php b/core/lib/Drupal/Component/Assertion/AssertionException.php
new file mode 100644
index 0000000..42da396
--- /dev/null
+++ b/core/lib/Drupal/Component/Assertion/AssertionException.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * @file
+ * Contains Drupal\Component\Assertion\AssertionException.
+ */
+
+namespace Drupal\Component\Assertion;
+
+/**
+ * Assert Fail Exception.
+ *
+ * Assertion aware tests (those which implement PHPUnitTestingTrait or
+ * AssertionTestingTrait in the Simpletest module) normally allow code to
+ * continue in spite of an assertion failure to see if the code remains
+ * (relatively) stable despite the failure. This is done because assert
+ * statements, unlike conditionals, can be turned off, and we need to test
+ * code behavior in that situation.
+ *
+ * Some assertions test conditions that *will* bring the code to a halt soon
+ * after the assertion if when they fail. If PHPUnit or simpletest is allowed
+ * to catch these errors any record that the assertion was thrown will be lost.
+ * Tests of those assertions must throw an exception to end the test
+ * immediately. Use this exception to insure it was the assert failure and
+ * not some other exception that ended the test.
+ *
+ * @see BaseTestingTrait
+ */
+class AssertionException extends \Exception {}
diff --git a/core/lib/Drupal/Component/Assertion/BaseTestingTrait.php b/core/lib/Drupal/Component/Assertion/BaseTestingTrait.php
new file mode 100644
index 0000000..1e0ab58
--- /dev/null
+++ b/core/lib/Drupal/Component/Assertion/BaseTestingTrait.php
@@ -0,0 +1,147 @@
+<?php
+/**
+ * @file
+ * Contains Drupal\Tests\BaseTestingTrait.
+ */
+
+namespace Drupal\Component\Assertion;
+
+/**
+ * Methods for unit testing code which uses the PHP assert function.
+ *
+ * By default both PHPUnit and Simpletest will stop when an assertion fails.
+ * This is usually sufficient - the vast majority of assertions are used to
+ * test the validity of method arguments when type hinting isn't sufficient,
+ * or to test the return of a method (at least until PHP 7 becomes the
+ * minimum).
+ *
+ * This trait contains helper methods for when you need to write a test
+ * that directly checks if an assertion passes or fails when it should.
+ * Since Drupal has two testing systems at the moment, this trait has two
+ * children.
+ *
+ * The trait establishes an assert callback that logs assert statements
+ * as they are raised and then it allows the code to continue executing as
+ * it would in production with assert statements turned off. Tests
+ * implementing this trait check this log to see if the expected assert
+ * failures did indeed occur and then removes them from the log. If
+ * unexpected assert failures occur they will cause the test to fail.
+ * Tests can also fail if an assert raise is expected but does not occur.
+ *
+ * Some assert statements check a condition which leads to a fatal error
+ * that will crash the test. When testing the failure of these assertions
+ * set the dieOnRaise flag to TRUE to cause an AssertionException to be
+ * thrown.
+ *
+ * To use this trait the following setup and teardown methods must be added
+ * to the implementing class.
+ *
+ * @code
+ * public function setUp() {
+ *   $this->startAssertionHandling();
+ *   parent::setUp();
+ * }
+ *
+ * public function tearDown() {
+ *   $this->stopAssertionHandling();
+ *   parent::setUp();
+ * }
+ * @endcode
+ */
+trait BaseTestingTrait {
+
+  /**
+   * Flag to throw an exception immediately on failure.
+   *
+   * @var bool
+   */
+  protected $dieOnRaise = FALSE;
+
+  /**
+   * Collections of captured assertions.
+   *
+   * @var array
+   */
+  protected $assertionsRaised = [];
+
+
+  /**
+   * Callback handler for assert raises during testing.
+   */
+  public function assertCallbackHandle($file, $line, $code, $message = '') {
+
+    // We print out this warning during test development, and since the
+    // automated tests run in strict mode it will cause a test failure.
+    if (!$code) {
+      print ('Assertions should always be strings! Even though PHP permits
+        other argument types, those arguments will be evaluated which causes
+        a loss of performance.');
+    }
+
+    // Usually we want to let the code continue evaluating as it is going to
+    // do when assertions are turned off just to make sure the code doesn't
+    // enter a fatal condition. However, some assertions are guarding against
+    // Fatal conditions anyway and there will be no way to recover from these
+    // failures. When testing these assertions, set the dieOnRaise flag which
+    // causes the exception throw here.
+    if ($this->dieOnRaise) {
+      throw new AssertionException($code . ' ' . $message);
+    }
+
+    // Otherwise we log the assertion as thrown and let the code continue.
+    $this->assertionsRaised[] = $code;
+
+    // Inform PHP we've successfully completed our handling of the assert fail.
+    return TRUE;
+  }
+
+  /**
+   * Start assertion handling for the test.
+   *
+   * Call this from setUp()
+   */
+  protected function startAssertionHandling() {
+    assert_options(ASSERT_WARNING, FALSE);
+    assert_options(ASSERT_BAIL, FALSE);
+    assert_options(ASSERT_CALLBACK, [$this, 'assertCallbackHandle']);
+    $this->assertionsRaised = [];
+    return FALSE;
+  }
+
+  /**
+   * Suspend assertion handling.
+   */
+  protected function suspendAssertionHandling() {
+    assert_options(ASSERT_WARNING, TRUE);
+    assert_options(ASSERT_CALLBACK, NULL);
+    $this->assertionsRaised = [];
+  }
+
+  /**
+   * Cease handling assertions and clear the way for the next test.
+   *
+   * Call this from tearDown()
+   */
+  protected function stopAssertionHandling() {
+    $this->assertAssertionNotRaised();
+    $this->suspendAssertionHandling();
+    $this->dieOnRaise = FALSE;
+  }
+
+  /**
+   * Check if the assertions specified where raised.
+   *
+   * This function can be overloaded. Assertions should be passed in the order
+   * they are expected to occur. After being accounted for the assertion count
+   * is reset.
+   */
+  abstract protected function assertAssertionsRaised();
+
+  /**
+   * Insure no assertions where thrown.
+   *
+   * Called during teardown, but you may wish to call it at other times.
+   */
+  abstract protected function assertAssertionNotRaised();
+
+}
diff --git a/core/lib/Drupal/Component/Assertion/PHPUnitTestingTrait.php b/core/lib/Drupal/Component/Assertion/PHPUnitTestingTrait.php
new file mode 100644
index 0000000..4337060
--- /dev/null
+++ b/core/lib/Drupal/Component/Assertion/PHPUnitTestingTrait.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * @file
+ * Contains Drupal\Component\Assertion\PHPUnitTestingTrait.
+ */
+
+namespace Drupal\Component\Assertion;
+
+
+/**
+ * Methods for testing the internal PHP assert function in PHPUnit.
+ */
+trait PHPUnitTestingTrait {
+  use BaseTestingTrait;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function assertAssertionsRaised() {
+    $this->assertEquals(func_get_args(), $this->assertionsRaised);
+    $this->assertionsRaised = [];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function assertAssertionNotRaised() {
+    $this->assertEmpty($this->assertionsRaised);
+  }
+
+}
diff --git a/core/modules/simpletest/src/AssertionTestingTrait.php b/core/modules/simpletest/src/AssertionTestingTrait.php
new file mode 100644
index 0000000..d29f9a6
--- /dev/null
+++ b/core/modules/simpletest/src/AssertionTestingTrait.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\simpletest\AssertionTestingTrait.
+ */
+
+namespace Drupal\simpletest;
+
+use Drupal\Component\Assertion\BaseTestingTrait;
+
+/**
+ * Methods for testing the internal PHP assert function in Simpletest.
+ *
+ */
+trait AssertionTestingTrait {
+  use BaseTestingTrait;
+  /**
+   * {@inheritdoc}
+   */
+  protected function assertAssertionsRaised() {
+    $this->assertIdentical(func_get_args(), $this->assertionsRaised, 'Expected Assertions Raised.');
+    $this->assertionsRaised = [];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function assertAssertionNotRaised() {
+    $this->assertTrue(count($this->assertionsRaised) === 0, 'No Assertions Raised');
+  }
+
+}
diff --git a/core/tests/Drupal/Tests/Component/Assertion/AssertionTest.php b/core/tests/Drupal/Tests/Component/Assertion/AssertionTest.php
new file mode 100644
index 0000000..16a77f6
--- /dev/null
+++ b/core/tests/Drupal/Tests/Component/Assertion/AssertionTest.php
@@ -0,0 +1,194 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\Tests\Component\AssertionTest.
+ */
+
+namespace Drupal\Tests\Component\Assertion;
+
+use ArrayObject;
+use PHPUnit_Framework_TestCase;
+use Drupal\Component\Assertion\Assertion;
+
+/**
+ * Test the static Assertion assisting Library.
+ *
+ * @coversDefaultClass \Drupal\Component\Assertion\Assertion
+ *
+ * @group Assertion
+ */
+class AssertionTest extends PHPUnit_Framework_TestCase {
+
+  /**
+   * Checks test to see if all members of an array share a property.
+   *
+   * @covers ::allMembersAre
+   */
+  public function testAllMembersAre() {
+    // Array of objects.
+    $this->assertTrue(
+      Assertion::allMembersAre('ArrayObject', [
+        new ArrayObject(),
+        new ArrayObject()
+      ])
+    );
+    // Traversable of objects.
+    $this->assertTrue(
+      Assertion::allMembersAre('ArrayObject', new ArrayObject([
+        new ArrayObject(),
+        new ArrayObject()
+      ]))
+    );
+    // Empty objects pass regardless - this assertion isn't for checking if
+    // objects are present.
+    $this->assertTrue(
+      Assertion::allMembersAre('foo', [])
+    );
+
+    // Non traversables fail.
+    $this->assertFalse(
+      Assertion::allMembersAre('foo', 'bar')
+    );
+
+    // All members are arrays.
+    $this->assertTrue(
+      Assertion::allMembersAre('array', [[], []])
+    );
+
+    $this->assertFalse(
+      Assertion::allMembersAre('array', ['bar', []])
+    );
+
+    // All members are integers.
+    foreach (['int', 'integer', 'long'] as $type_alias) {
+      $this->assertTrue(
+        Assertion::allMembersAre($type_alias, [1, 2, 3])
+      );
+
+      $this->assertFalse(
+        Assertion::allMembersAre($type_alias, [1, 2, 3, []])
+      );
+    }
+
+    // All members are floats.
+    foreach (['float', 'double', 'real'] as $type_alias) {
+      $this->assertTrue(
+        Assertion::allMembersAre($type_alias, [1.1, 2.2, 3.14])
+      );
+
+      $this->assertFalse(
+        Assertion::allMembersAre($type_alias, [1.2, 2, 3, []])
+      );
+    }
+
+    // All members can be called.
+    $this->assertTrue(
+      Assertion::allMembersAre('callable', [
+        'strchr',
+        [$this, 'callMe'],
+        [__CLASS__, 'callMeStatic'],
+        function() {
+          return TRUE;
+        }
+      ])
+    );
+
+    $this->assertFalse(
+      Assertion::allMembersAre('callable', [
+        'strchr',
+        [$this, 'callMe'],
+        [__CLASS__, 'callMeStatic'],
+        function() {
+          return TRUE;
+        },
+        'bye'
+      ])
+    );
+
+    // All members are numeric. This includes numeric strings.
+    $this->assertTrue(
+      Assertion::allMembersAre('numeric', [1, 1.2, '3'])
+    );
+
+    $this->assertFalse(
+      Assertion::allMembersAre('numeric', [1, 1.2, '3', 'pi'])
+    );
+
+    // All members have something.
+    $this->assertTrue(
+      Assertion::allMembersAre('not-empty', [1, 'foo'])
+    );
+
+    $this->assertFalse(
+      Assertion::allMembersAre('not-empty', [''])
+    );
+
+    // All members are objects.
+    $this->assertTrue(
+      Assertion::allMembersAre('object', [
+        new ArrayObject(),
+        new \stdClass()
+      ])
+    );
+
+    $this->assertFalse(
+      Assertion::allMembersAre('ArrayObject', [
+        new ArrayObject(),
+        []
+      ])
+    );
+
+    // Create a string mock.
+    $string_object = new StringObject();
+
+    // Now test strictly against the string type.
+    $this->assertTrue(
+      Assertion::allMembersAre('string', ['bar', 'foo'])
+    );
+
+    $this->assertFalse(
+      Assertion::allMembersAre('string', [$string_object])
+    );
+
+    // But a stringable object should pass stringable.
+    $this->assertTrue(
+      Assertion::allMembersAre('stringable', ['bar', $string_object])
+    );
+
+    $this->assertFalse(
+      Assertion::allMembersAre('stringable', [42])
+    );
+
+  }
+
+  /**
+   * Call me sometime.
+   *
+   * This method exists as part of the is_callable test.
+   */
+  public function callMe() {
+    return TRUE;
+  }
+
+  /**
+   * Call me static.
+   *
+   * Again, just a testing method.
+   */
+  public static function callMeStatic() {
+    return TRUE;
+  }
+
+}
+/**
+ * Quick class for testing for objects with __toString.
+ */
+class StringObject {
+  /**
+   * {@inheritdoc}
+   */
+  public function __toString() {
+    return 'foo';
+  }
+
+}
diff --git a/core/tests/Drupal/Tests/Component/Assertion/AssertionTestTraitTest.php b/core/tests/Drupal/Tests/Component/Assertion/AssertionTestTraitTest.php
new file mode 100644
index 0000000..27c87a1
--- /dev/null
+++ b/core/tests/Drupal/Tests/Component/Assertion/AssertionTestTraitTest.php
@@ -0,0 +1,84 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\Tests\Component\AssertionTest.
+ */
+
+namespace Drupal\Tests\Component\Assertion;
+
+use ArrayObject;
+use PHPUnit_Framework_TestCase;
+use Drupal\Component\Assertion\PHPUnitTestingTrait;
+
+/**
+ * Tests for the Assert traits in PHPUnit.
+ *
+ * @coversDefaultClass \Drupal\Component\Assertion\PHPUnitTestingTrait
+ *
+ * @group Assertion
+ */
+class AssertionTestTraitTest extends PHPUnit_Framework_TestCase {
+  use PHPUnitTestingTrait;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    $this->startAssertionHandling();
+    parent::setUp();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function tearDown() {
+    $this->stopAssertionHandling();
+    $this->assertAssertionNotRaised();
+    parent::setUp();
+  }
+
+  /**
+   * Test the PHPUnit Assert assist trait.
+   *
+   * This test is a bit unusual since we're self testing. The traits being
+   * tested are part of this object.
+   */
+  public function testBasics() {
+    // Normal assert.
+    assert('1 > 2');
+    $this->assertAssertionsRaised('1 > 2');
+
+    // Assert without string pitches error.
+    ob_start();
+    assert(1 > 2);
+    $output = ob_get_clean();
+
+    $this->assertEquals($output,
+      'Assertions should always be strings! Even though PHP permits
+        other argument types, those arguments will be evaluated which causes
+        a loss of performance.');
+
+    $this->assertAssertionsRaised('');
+
+    // Assertion log should be empty after the above call.
+    $this->assertAssertionNotRaised();
+
+    // Test accumulation of assert failures.
+    assert('1 > 2');
+    assert('4 < 2');
+    assert('false');
+
+    $this->assertAssertionsRaised('1 > 2', '4 < 2', 'false');
+  }
+
+  /**
+   * Tests if an exception is thrown when dieOnRaise is set.
+   *
+   * @expectedException \Drupal\Component\Assertion\AssertionException
+   */
+  public function testAssertionExceptionThrow() {
+    $this->dieOnRaise = TRUE;
+    assert('4 < 2');
+  }
+
+}
diff --git a/sites/example.settings.local.php b/sites/example.settings.local.php
index 4cc2109..798ff38 100644
--- a/sites/example.settings.local.php
+++ b/sites/example.settings.local.php
@@ -12,6 +12,20 @@
  */
 
 /**
+ * Assertions
+ *
+ * Drupal uses assert statements to perform validations that are only
+ * necessary during module and theme development, and that slow the system
+ * down. By default the statements are turned off in the .htaccess file.
+ * Here we turn them back on which should be sufficient for most projects,
+ * but assert statements located before the DrupalKernel parses this file
+ * will not be ran unless you modify the .htaccess file. We also set the
+ * system to halt on assert fail, just in case.
+ */
+assert_options(ASSERT_ACTIVE, 1);
+assert_options(ASSERT_BAIL, 1);
+
+/**
  * Enable local development services.
  */
 $settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
