diff --git a/core/modules/system/lib/Drupal/system/Tests/Error/FormatBacktraceUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Error/FormatBacktraceUnitTest.php
new file mode 100644
index 0000000..7eb156d
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/Error/FormatBacktraceUnitTest.php
@@ -0,0 +1,67 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\system\Tests\Common\ValidNumberStepUnitTest.
+ */
+
+namespace Drupal\system\Tests\Error;
+
+use Drupal\simpletest\UnitTestBase;
+
+/**
+ * Tests backtrace formatting by format_backtrace().
+ */
+class FormatBacktraceUnitTest extends UnitTestBase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Format Backtrace validation',
+      'description' => 'Tests backtrace formatting by format_backtrace()',
+      'group' => 'Error',
+    );
+  }
+
+  /**
+   * Tests format_backtrace() with test arrays.
+   */
+  public function testFormatBacktrace() {
+    // Test array.
+    $backtrace = array(
+      array(
+        'class' => 'class',
+        'type' => 'type',
+        'function' => 'function',
+        'args' => array(1, 1., NULL, new \stdClass, 'foo'),
+      ),
+      array(
+        'class' => 'class',
+        'type' => 'type',
+        'function' => 'function',
+      ),
+      array(
+        'function' => 'function',
+        'args' => array(1, 1., NULL, new \stdClass, 'foo'),
+      ),
+
+      array(
+        'function' => 'function',
+      ),
+      array(
+        'args' => array(1, 1., NULL, new \stdClass, 'foo'),
+      ),
+      array(
+      ),
+    );
+
+    $result = 'classtypefunction(1, 1, NULL, Object, \'foo\')
+classtypefunction()
+function(1, 1, NULL, Object, \'foo\')
+function()
+main(1, 1, NULL, Object, \'foo\')
+main()
+';
+
+    // Compare to the given format.
+    $this->assertEqual(format_backtrace($backtrace), $result);
+  }
+}
