Yaffs site version 1.1
[yaffs-website] / vendor / caxy / php-htmldiff / tests / Caxy / Tests / HtmlDiff / Functional / HtmlDiffFunctionalTest.php
1 <?php
2
3 namespace Caxy\Tests\HtmlDiff\Functional;
4
5 use Caxy\HtmlDiff\HtmlDiff;
6 use Caxy\Tests\AbstractTest;
7 use Caxy\Tests\HtmlDiff\HtmlFileIterator;
8
9 class HtmlDiffFunctionalTest extends AbstractTest
10 {
11     /**
12      * @dataProvider diffContentProvider
13      *
14      * @param $oldText
15      * @param $newText
16      * @param $expected
17      */
18     public function testHtmlDiff($oldText, $newText, $expected)
19     {
20         $diff = new HtmlDiff(trim($oldText), trim($newText), 'UTF-8', array());
21         $output = $diff->build();
22
23         static::assertEquals($this->stripExtraWhitespaceAndNewLines($expected), $this->stripExtraWhitespaceAndNewLines($output));
24     }
25
26     public function diffContentProvider()
27     {
28         return new HtmlFileIterator(__DIR__.'/../../../../fixtures/HtmlDiff');
29     }
30 }