diff --git a/core/lib/Drupal/Component/Diff/DiffEngine.php b/core/lib/Drupal/Component/Diff/DiffEngine.php
index 0194379..57e34d6 100644
--- a/core/lib/Drupal/Component/Diff/DiffEngine.php
+++ b/core/lib/Drupal/Component/Diff/DiffEngine.php
@@ -570,7 +570,7 @@ function _shift_boundaries($lines, &$changed, $other_changed) {
  * @subpackage DifferenceEngine
  */
 class Diff {
-  var $edits;
+  public $edits;
 
   /**
    * Constructor.
@@ -580,7 +580,7 @@ class Diff {
    *      (Typically these are lines from a file.)
    * @param $to_lines array An array of strings.
    */
-  function Diff($from_lines, $to_lines) {
+  public function __construct($from_lines, $to_lines) {
     $eng = new _DiffEngine;
     $this->edits = $eng->diff($from_lines, $to_lines);
     //$this->_check($from_lines, $to_lines);
diff --git a/core/tests/Drupal/Tests/Component/Diff/DiffEngineTest.php b/core/tests/Drupal/Tests/Component/Diff/DiffEngineTest.php
new file mode 100644
index 0000000..8b4d41f
--- /dev/null
+++ b/core/tests/Drupal/Tests/Component/Diff/DiffEngineTest.php
@@ -0,0 +1,87 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Component\DiffEngineTest.
+ */
+
+namespace Drupal\Tests\Component\Diff;
+
+// Since this file holds more than a few classes, we can't rely on
+// autoloading the classes in its namespace.
+require_once(__DIR__ . '/../../../../../../core/lib/Drupal/Component/Diff/DiffEngine.php');
+
+use Diff;
+use _DiffOp_Copy;
+use _DiffOp_Add;
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * Tests the DiffEngine class.
+ *
+ * @group Drupal
+ * @group Component
+ * @group DiffEngine
+ */
+class DiffEngineTest extends UnitTestCase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'DiffEngine',
+      'description' => 'Tests the DiffEngine class.',
+      'group' => 'System',
+    );
+  }
+
+  /**
+   * Data provider for testDiff().
+   *
+   * @return
+   *  array Test data.
+   */
+  public function providerTestDiff() {
+    return array(
+      array(
+        // $expected
+        array(
+          new _DiffOp_Copy(array('Hello World')),
+          new _DiffOp_Add(array('I am a new line')),
+          new _DiffOp_Copy(array('I am an original line'))
+        ),
+        // $old
+        array(
+          'Hello World',
+          'I am an original line'
+        ),
+        // $new
+        array(
+          'Hello World',
+          'I am a new line',
+          'I am an original line'
+        ),
+      ),
+    );
+  }
+
+  /**
+   * Tests Diff::Diff().
+   *
+   * A basic test of the Diff class.
+   *
+   * @dataProvider providerTestDiff
+   */
+  public function testDiff($expected, $old, $new) {
+    $diff = new Diff($old, $new);
+    $this->assertCount(count($expected), $diff->edits);
+
+    foreach ($diff->edits as $key => $diffObject) {
+      $this->assertInstanceOf(get_class($expected[$key]), $diffObject);
+      $this->assertSame($expected[$key]->orig, $diffObject->orig);
+      $this->assertSame($expected[$key]->closing, $diffObject->closing);
+    }
+  }
+
+}
