/**
  * Test for DiffHistoryBlob::xdiffAdler32()
  * @dataProvider provideXdiffAdler32
  */
 function testXdiffAdler32($input)
 {
     $xdiffHash = substr(xdiff_string_rabdiff($input, ''), 0, 4);
     $dhb = new DiffHistoryBlob();
     $myHash = $dhb->xdiffAdler32($input);
     $this->assertSame(bin2hex($xdiffHash), bin2hex($myHash), "Hash of " . addcslashes($input, "..!@\\@..ÿ"));
 }
Esempio n. 2
0
 /**
  * @param $t1
  * @param $t2
  * @return string
  */
 function diff($t1, $t2)
 {
     # Need to do a null concatenation with warnings off, due to bugs in the current version of xdiff
     # "String is not zero-terminated"
     wfSuppressWarnings();
     $diff = xdiff_string_rabdiff($t1, $t2) . '';
     wfRestoreWarnings();
     return $diff;
 }