/**
  * 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();
 }
Exemplo n.º 2
0
 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&para;<br></span><del style="background:#ffe6e6;">&lt;B&gt;b&lt;/B&gt;</del><ins style="background:#e6ffe6;">c&amp;d</ins>', $this->d->prettyHtml());
 }