19 $this->assertEquals( $expectedOutput,
$output );
23 $diff = $this->getMockBuilder(
'Diff' )
24 ->disableOriginalConstructor()
26 $diff->expects( $this->
any() )
27 ->method(
'getEdits' )
28 ->will( $this->returnValue( $edits ) );
33 $diffOp = $this->getMockBuilder(
'DiffOp' )
34 ->disableOriginalConstructor()
36 $diffOp->expects( $this->
any() )
38 ->will( $this->returnValue(
$type ) );
39 $diffOp->expects( $this->
any() )
41 ->will( $this->returnValue( $orig ) );
42 if (
$type ===
'change' ) {
43 $diffOp->expects( $this->
any() )
44 ->method(
'getClosing' )
45 ->with( $this->isType(
'integer' ) )
46 ->will( $this->returnCallback(
function () {
50 $diffOp->expects( $this->
any() )
51 ->method(
'getClosing' )
52 ->will( $this->returnValue( $closing ) );
58 $emptyArrayTestCases = [
73 [ [
'action' =>
'add',
'new' =>
'a1',
'newline' => 1 ] ],
78 [
'action' =>
'add',
'new' =>
'a1',
'newline' => 1 ],
79 [
'action' =>
'add',
'new' =>
'a2',
'newline' => 2 ],
84 [ [
'action' =>
'delete',
'old' =>
'd1',
'oldline' => 1 ] ],
89 [
'action' =>
'delete',
'old' =>
'd1',
'oldline' => 1 ],
90 [
'action' =>
'delete',
'old' =>
'd2',
'oldline' => 2 ],
99 'newline' => 1,
'oldline' => 1
102 $otherTestCases[] = [
110 'action' =>
'change',
113 'newline' => 1,
'oldline' => 1
116 'action' =>
'change',
119 'newline' => 2,
'oldline' => 2
125 foreach ( $emptyArrayTestCases
as $testCase ) {
126 $testCases[] = [ $testCase, [] ];
128 foreach ( $otherTestCases
as $testCase ) {
129 $testCases[] = [ $testCase[0], $testCase[1] ];