b2evolution PHP Cross Reference Blogging Systems

Source: /inc/_ext/phpsvnclient/ext/Diff/tests/context2.phpt - 31 lines - 712 bytes - Text - Print

   1  --TEST--
   2  Text_Diff: Context renderer 2
   3  --FILE--
   4  <?php
   5  include_once 'Text/Diff.php';
   6  include_once 'Text/Diff/Renderer/context.php';
   7  
   8  $lines1 = file(dirname(__FILE__) . '/5.txt');
   9  $lines2 = file(dirname(__FILE__) . '/6.txt');
  10  
  11  $diff = new Text_Diff('native', array($lines1, $lines2));
  12  
  13  $renderer = new Text_Diff_Renderer_context();
  14  echo $renderer->render($diff);
  15  ?>
  16  --EXPECT--
  17  ***************
  18  *** 1,5 ****
  19    This is a test.
  20    Adding random text to simulate files.
  21    Various Content.
  22  ! More Content.
  23  ! Testing diff and renderer.
  24  --- 1,7 ----
  25    This is a test.
  26    Adding random text to simulate files.
  27  + Inserting a line.
  28    Various Content.
  29  ! Replacing content.
  30  ! Testing similarities and renderer.
  31  ! Append content.

title

Description

title

Description

title

Description

title

title

Body