Version 1
[yaffs-website] / vendor / caxy / php-htmldiff / tests / Caxy / Tests / HtmlDiff / Functional / HtmlDiffFunctionalTest.php
diff --git a/vendor/caxy/php-htmldiff/tests/Caxy/Tests/HtmlDiff/Functional/HtmlDiffFunctionalTest.php b/vendor/caxy/php-htmldiff/tests/Caxy/Tests/HtmlDiff/Functional/HtmlDiffFunctionalTest.php
new file mode 100644 (file)
index 0000000..4591cca
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+namespace Caxy\Tests\HtmlDiff\Functional;
+
+use Caxy\HtmlDiff\HtmlDiff;
+use Caxy\Tests\AbstractTest;
+use Caxy\Tests\HtmlDiff\HtmlFileIterator;
+
+class HtmlDiffFunctionalTest extends AbstractTest
+{
+    /**
+     * @dataProvider diffContentProvider
+     *
+     * @param $oldText
+     * @param $newText
+     * @param $expected
+     */
+    public function testHtmlDiff($oldText, $newText, $expected)
+    {
+        $diff = new HtmlDiff(trim($oldText), trim($newText), 'UTF-8', array());
+        $output = $diff->build();
+
+        static::assertEquals($this->stripExtraWhitespaceAndNewLines($expected), $this->stripExtraWhitespaceAndNewLines($output));
+    }
+
+    public function diffContentProvider()
+    {
+        return new HtmlFileIterator(__DIR__.'/../../../../fixtures/HtmlDiff');
+    }
+}