b2evolution PHP Cross Reference Blogging Systems

Source: /inc/_ext/phpsvnclient/ext/Diff/tests/diff.phpt - 62 lines - 1503 bytes - Text - Print

   1  --TEST--
   2  Text_Diff: Basic diff operation
   3  --FILE--
   4  <?php
   5  include_once 'Text/Diff.php';
   6  
   7  $lines1 = file(dirname(__FILE__) . '/1.txt');
   8  $lines2 = file(dirname(__FILE__) . '/2.txt');
   9  
  10  $diff = new Text_Diff('native', array($lines1, $lines2));
  11  echo strtolower(print_r($diff, true));
  12  ?>
  13  --EXPECT--
  14  text_diff object
  15  (
  16      [_edits] => array
  17          (
  18              [0] => text_diff_op_copy object
  19                  (
  20                      [orig] => array
  21                          (
  22                              [0] => this line is the same.
  23                          )
  24  
  25                      [final] => array
  26                          (
  27                              [0] => this line is the same.
  28                          )
  29  
  30                  )
  31  
  32              [1] => text_diff_op_change object
  33                  (
  34                      [orig] => array
  35                          (
  36                              [0] => this line is different in 1.txt
  37                          )
  38  
  39                      [final] => array
  40                          (
  41                              [0] => this line is different in 2.txt
  42                          )
  43  
  44                  )
  45  
  46              [2] => text_diff_op_copy object
  47                  (
  48                      [orig] => array
  49                          (
  50                              [0] => this line is the same.
  51                          )
  52  
  53                      [final] => array
  54                          (
  55                              [0] => this line is the same.
  56                          )
  57  
  58                  )
  59  
  60          )
  61  
  62  )

title

Description

title

Description

title

Description

title

title

Body