x), explode("\n", $this->y)); $diffformatter = new TableDiffFormatter(); $actual = $diffformatter->format($diff); $expected = 'Line 1: Line 1: -zzz+ddd     aaa aaa  +  +bbb     bbb bbb Line 7: Line 9:  ccc ccc    -ddd +ccc - + -ddd + - + -ddd+     eee eee -  -fff  '; $this->assertEquals($expected, $actual); } function test_render_inline(){ $diff = new Diff(explode("\n", $this->x), explode("\n", $this->y)); $diffformatter = new InlineDiffFormatter(); $actual = $diffformatter->format($diff); $expected = '@@ Line -1,5 +1,7 @@ removed created  zzzddd    aaa    bbb    bbb @@ Line -7,11 +9,5 @@ removed created  ccc    ddd      ddd      dddccc    eee    fff '; $this->assertEquals($expected, $actual); } function test_engine_diag(){ // initialize $eng = new _DiffEngine; $eng->diff(explode("\n", $this->x), explode("\n", $this->y)); // check $this->assertEquals( array(9, array(array(0,0),array(1,2),array(3,4),array(4,5),array(5,7),array(6,9),array(7,10),array(9,12),array(15,13))), $eng->_diag(0, 15, 0, 13, 8) ); } } //Setup VIM: ex: et ts=4 :