b2evolution PHP Cross Reference Blogging Systems

Source: /inc/_ext/phpsvnclient/ext/Diff/tests/inline2.phpt - 37 lines - 939 bytes - Text - Print

   1  --TEST--
   2  Text_Diff: Inline renderer 2
   3  --FILE--
   4  <?php
   5  include_once 'Text/Diff.php';
   6  include_once 'Text/Diff/Renderer/inline.php';
   7  
   8  $lines1 = array(
   9      "This is a test.\n",
  10      "Adding random text to simulate files.\n",
  11      "Various Content.\n",
  12      "More Content.\n",
  13      "Testing diff and renderer.\n"
  14  );
  15  $lines2 = array(
  16      "This is a test.\n",
  17      "Adding random text to simulate files.\n",
  18      "Inserting a line.\n",
  19      "Various Content.\n",
  20      "Replacing content.\n",
  21      "Testing similarities and renderer.\n",
  22      "Append content.\n"
  23  );
  24  
  25  $diff = new Text_Diff('native', array($lines1, $lines2));
  26  
  27  $renderer = new Text_Diff_Renderer_inline();
  28  echo $renderer->render($diff);
  29  ?>
  30  --EXPECT--
  31  This is a test.
  32  Adding random text to simulate files.
  33  <ins>Inserting a line.</ins>
  34  Various Content.
  35  <del>More Content.</del><ins>Replacing content.</ins>
  36  Testing <del>diff</del><ins>similarities</ins> and renderer.<ins>
  37  Append content.</ins>

title

Description

title

Description

title

Description

title

title

Body