/** * Convert a diff array into a pretty HTML report. * * @param array $diffs Array of diff arrays. * * @return string HTML representation. */ public function diff_prettyHtml($diffs) { $this->diff->setChanges($diffs); return $this->diff->prettyHtml(); }
public function testPrettyHtml() { // Pretty print. $this->d->setChanges(array(array(Diff::EQUAL, "a\n"), array(Diff::DELETE, "<B>b</B>"), array(Diff::INSERT, "c&d"))); $this->assertEquals('<span>a¶<br></span><del style="background:#ffe6e6;"><B>b</B></del><ins style="background:#e6ffe6;">c&d</ins>', $this->d->prettyHtml()); }