Completed
Push — master ( fcf711...00bb57 )
by
unknown
02:50
created

tests/phpunit/DiffOp/Diff/DiffTest.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Diff\Tests\DiffOp\Diff;
4
5
use Diff\DiffOp\Diff\Diff;
6
use Diff\DiffOp\Diff\ListDiff;
7
use Diff\DiffOp\Diff\MapDiff;
8
use Diff\DiffOp\DiffOp;
9
use Diff\DiffOp\DiffOpAdd;
10
use Diff\DiffOp\DiffOpChange;
11
use Diff\DiffOp\DiffOpRemove;
12
use Diff\Tests\DiffTestCase;
13
use stdClass;
14
15
/**
16
 * @covers Diff\DiffOp\Diff\Diff
17
 *
18
 * @group Diff
19
 * @group DiffOp
20
 *
21
 * @licence GNU GPL v2+
22
 * @author Jeroen De Dauw < [email protected] >
23
 * @author Thiemo Mättig
24
 */
25
class DiffTest extends DiffTestCase {
26
27
	public function elementInstancesProvider() {
28
		return array(
29
			array( array(
30
			) ),
31
			array( array(
32
				new DiffOpAdd( 'ohi' )
33
			) ),
34
			array( array(
35
				new DiffOpRemove( 'ohi' )
36
			) ),
37
			array( array(
38
				new DiffOpAdd( 'ohi' ),
39
				new DiffOpRemove( 'there' )
40
			) ),
41
			array( array(
42
			) ),
43
			array( array(
44
				new DiffOpAdd( 'ohi' ),
45
				new DiffOpRemove( 'there' ),
46
				new DiffOpChange( 'ohi', 'there' )
47
			) ),
48
			array( array(
49
				'1' => new DiffOpAdd( 'ohi' ),
50
				'33' => new DiffOpRemove( 'there' ),
51
				'7' => new DiffOpChange( 'ohi', 'there' )
52
			) ),
53
		);
54
	}
55
56
	/**
57
	 * @dataProvider elementInstancesProvider
58
	 * @param DiffOp[] $operations
59
	 */
60
	public function testGetAdditions( array $operations ) {
61
		$diff = new Diff( $operations, true );
62
63
		$additions = array();
64
65
		foreach ( $operations as $operation ) {
66
			if ( $operation->getType() == 'add' ) {
67
				$additions[] = $operation;
68
			}
69
		}
70
71
		$this->assertArrayEquals( $additions, $diff->getAdditions() );
72
	}
73
74
	/**
75
	 * @dataProvider elementInstancesProvider
76
	 * @param DiffOp[] $operations
77
	 */
78
	public function testGetRemovals( array $operations ) {
79
		$diff = new Diff( $operations, true );
80
81
		$removals = array();
82
83
		foreach ( $operations as $operation ) {
84
			if ( $operation->getType() == 'remove' ) {
85
				$removals[] = $operation;
86
			}
87
		}
88
89
		$this->assertArrayEquals( $removals, $diff->getRemovals() );
90
	}
91
92
	public function testGetType() {
93
		$diff = new Diff();
94
		$this->assertInternalType( 'string', $diff->getType() );
95
	}
96
97
	public function testPreSetElement() {
98
		$this->setExpectedException( 'Exception' );
99
100
		$diff = new Diff( array(), false );
101
		$diff[] = new DiffOpChange( 0, 1 );
102
	}
103
104
	/**
105
	 * @dataProvider elementInstancesProvider
106
	 * @param DiffOp[] $operations
107
	 */
108
	public function testAddOperations( array $operations ) {
109
		$diff = new Diff();
110
111
		$diff->addOperations( $operations );
112
113
		$this->assertArrayEquals( $operations, $diff->getOperations() );
114
	}
115
116
	/**
117
	 * @dataProvider elementInstancesProvider
118
	 * @param DiffOp[] $operations
119
	 */
120
	public function testStuff( array $operations ) {
121
		$diff = new Diff( $operations );
122
123
		$this->assertInstanceOf( 'Diff\DiffOp\Diff\Diff', $diff );
124
		$this->assertInstanceOf( 'ArrayObject', $diff );
125
126
		$types = array();
127
128
		$this->assertContainsOnlyInstancesOf( 'Diff\DiffOp\DiffOp', $diff );
129
130
		/**
131
		 * @var DiffOp $operation
132
		 */
133
		foreach ( $diff as $operation ) {
134
			if ( !in_array( $operation->getType(), $types ) ) {
135
				$types[] = $operation->getType();
136
			}
137
		}
138
139
		$count = 0;
140
141
		foreach ( $types as $type ) {
142
			$count += count( $diff->getTypeOperations( $type ) );
143
		}
144
145
		$this->assertEquals( $count, $diff->count() );
146
	}
147
148
	public function instanceProvider() {
149
		$instances = array();
150
151
		foreach ( $this->elementInstancesProvider() as $args ) {
152
			$diffOps = $args[0];
153
			$instances[] = array( new Diff( $diffOps ) );
154
		}
155
156
		return $instances;
157
	}
158
159
	/**
160
	 * @dataProvider instanceProvider
161
	 */
162
	public function testGetOperations( Diff $diff ) {
163
		$ops = $diff->getOperations();
164
165
		$this->assertInternalType( 'array', $ops );
166
		$this->assertContainsOnlyInstancesOf( 'Diff\DiffOp\DiffOp', $ops );
167
		$this->assertArrayEquals( $ops, $diff->getOperations() );
168
	}
169
170
	public function testRemoveEmptyOperations() {
171
		$diff = new Diff( array() );
172
173
		$diff['foo'] = new DiffOpAdd( 1 );
174
		$diff['bar'] = new Diff( array( new DiffOpAdd( 1 ) ), true );
175
		$diff['baz'] = new Diff( array( new DiffOpAdd( 1 ) ), false );
176
		$diff['bah'] = new Diff( array(), false );
177
		$diff['spam'] = new Diff( array(), true );
178
179
		$diff->removeEmptyOperations();
180
181
		$this->assertTrue( $diff->offsetExists( 'foo' ) );
182
		$this->assertTrue( $diff->offsetExists( 'bar' ) );
183
		$this->assertTrue( $diff->offsetExists( 'baz' ) );
184
		$this->assertFalse( $diff->offsetExists( 'bah' ) );
185
		$this->assertFalse( $diff->offsetExists( 'spam' ) );
186
	}
187
188
	public function looksAssociativeProvider() {
189
		$argLists = array();
190
191
		$diff = new Diff();
192
193
		$argLists[] = array( $diff, false );
194
195
196
		$diff = new Diff( array(), false );
197
198
		$argLists[] = array( $diff, false );
199
200
201
		$diff = new Diff( array(), true );
202
203
		$argLists[] = array( $diff, true );
204
205
206
		$diff = new Diff( array( new DiffOpAdd( '' ) ) );
207
208
		$argLists[] = array( $diff, false );
209
210
211
		$diff = new Diff( array( new DiffOpRemove( '' ) ) );
212
213
		$argLists[] = array( $diff, false );
214
215
216
		$diff = new Diff( array( new DiffOpRemove( '' ), new DiffOpAdd( '' ) ) );
217
218
		$argLists[] = array( $diff, false );
219
220
221
		$diff = new Diff( array( new DiffOpRemove( '' ) ), true );
222
223
		$argLists[] = array( $diff, true );
224
225
226
		$diff = new Diff( array( 'onoez' => new DiffOpChange( '', 'spam' ) ) );
227
228
		$argLists[] = array( $diff, true );
229
230
231
		$diff = new Diff( array( new Diff() ) );
232
233
		$argLists[] = array( $diff, true );
234
235
		return $argLists;
236
	}
237
238
	/**
239
	 * @dataProvider looksAssociativeProvider
240
	 */
241
	public function testLooksAssociative( Diff $diff, $looksAssoc ) {
242
		$this->assertEquals( $looksAssoc, $diff->looksAssociative() );
243
244
		if ( !$diff->looksAssociative() ) {
245
			$this->assertFalse( $diff->hasAssociativeOperations() );
246
		}
247
	}
248
249
	public function isAssociativeProvider() {
250
		$argLists = array();
251
252
		$diff = new Diff();
253
254
		$argLists[] = array( $diff, null );
255
256
257
		$diff = new Diff( array(), false );
258
259
		$argLists[] = array( $diff, false );
260
261
262
		$diff = new Diff( array(), true );
263
264
		$argLists[] = array( $diff, true );
265
266
267
		$diff = new Diff( array( new DiffOpAdd( '' ) ) );
268
269
		$argLists[] = array( $diff, null );
270
271
272
		$diff = new Diff( array( new DiffOpRemove( '' ) ), false );
273
274
		$argLists[] = array( $diff, false );
275
276
277
		$diff = new Diff( array( new DiffOpRemove( '' ), new DiffOpAdd( '' ) ) );
278
279
		$argLists[] = array( $diff, null );
280
281
282
		$diff = new Diff( array( new DiffOpRemove( '' ) ), true );
283
284
		$argLists[] = array( $diff, true );
285
286
287
		$diff = new Diff( array( 'onoez' => new DiffOpChange( '', 'spam' ) ) );
288
289
		$argLists[] = array( $diff, null );
290
291
292
		$diff = new Diff( array( new Diff() ) );
293
294
		$argLists[] = array( $diff, null );
295
296
		return $argLists;
297
	}
298
299
	/**
300
	 * @dataProvider isAssociativeProvider
301
	 */
302
	public function testIsAssociative( Diff $diff, $isAssoc ) {
303
		$this->assertEquals( $isAssoc, $diff->isAssociative() );
304
	}
305
306
	public function hasAssociativeOperationsProvider() {
307
		$argLists = array();
308
309
		$diff = new Diff();
310
311
		$argLists[] = array( $diff, false );
312
313
314
		$diff = new Diff( array(), false );
315
316
		$argLists[] = array( $diff, false );
317
318
319
		$diff = new Diff( array(), true );
320
321
		$argLists[] = array( $diff, false );
322
323
324
		$diff = new Diff( array( new DiffOpAdd( '' ) ) );
325
326
		$argLists[] = array( $diff, false );
327
328
329
		$diff = new Diff( array( new DiffOpRemove( '' ) ), false );
330
331
		$argLists[] = array( $diff, false );
332
333
334
		$diff = new Diff( array( new DiffOpRemove( '' ), new DiffOpAdd( '' ) ), true );
335
336
		$argLists[] = array( $diff, false );
337
338
339
		$diff = new Diff( array( new DiffOpRemove( '' ) ), true );
340
341
		$argLists[] = array( $diff, false );
342
343
344
		$diff = new Diff( array( 'onoez' => new DiffOpChange( '', 'spam' ) ) );
345
346
		$argLists[] = array( $diff, true );
347
348
349
		$diff = new Diff( array( new Diff() ) );
350
351
		$argLists[] = array( $diff, true );
352
353
		return $argLists;
354
	}
355
356
	/**
357
	 * @dataProvider hasAssociativeOperationsProvider
358
	 */
359
	public function testHasAssociativeOperations( Diff $diff, $hasAssocOps ) {
360
		$this->assertEquals( $hasAssocOps, $diff->hasAssociativeOperations() );
361
	}
362
363
	public function testSerializationCompat() {
364
		// @codingStandardsIgnoreStart
365
		$v03serialization = 'C:12:"Diff\MapDiff":569:{a:4:{s:4:"data";a:4:{i:0;C:14:"Diff\DiffOpAdd":10:{s:3:"add";}i:1;C:17:"Diff\DiffOpRemove":10:{s:3:"rem";}i:2;C:17:"Diff\DiffOpChange":30:{a:2:{i:0;s:1:"b";i:1;s:1:"a";}}i:3;C:13:"Diff\ListDiff":170:{a:4:{s:4:"data";a:1:{i:0;C:17:"Diff\DiffOpRemove":10:{s:3:"rem";}}s:5:"index";i:0;s:12:"typePointers";a:2:{s:3:"add";a:0:{}s:6:"remove";a:1:{i:0;i:0;}}s:9:"parentKey";N;}}}s:5:"index";i:0;s:12:"typePointers";a:6:{s:3:"add";a:1:{i:0;i:0;}s:6:"remove";a:1:{i:0;i:1;}s:6:"change";a:1:{i:0;i:2;}s:4:"list";a:1:{i:0;i:3;}s:3:"map";a:0:{}s:4:"diff";a:0:{}}s:9:"parentKey";N;}}';
366
		// @codingStandardsIgnoreEnd
367
368
		/**
369
		 * @var Diff $diff
370
		 */
371
		$diff = unserialize( $v03serialization );
372
373
		$this->assertInstanceOf( 'Diff\Diff', $diff );
374
		$this->assertTrue( $diff->isAssociative() );
375
		$this->assertSame( 4, $diff->count() );
376
		$this->assertSame( 1, count( $diff->getAdditions() ) );
377
		$this->assertSame( 1, count( $diff->getRemovals() ) );
378
		$this->assertSame( 1, count( $diff->getChanges() ) );
379
	}
380
381
	/**
382
	 * @dataProvider elementInstancesProvider
383
	 *
384
	 * @since 0.6
385
	 *
386
	 * @param DiffOp[] $elements
387
	 */
388
	public function testConstructor( array $elements ) {
389
		$arrayObject = new Diff( $elements );
390
391
		$this->assertEquals( count( $elements ), $arrayObject->count() );
392
	}
393
394
	/**
395
	 * @dataProvider elementInstancesProvider
396
	 *
397
	 * @since 0.6
398
	 *
399
	 * @param DiffOp[] $elements
400
	 */
401
	public function testIsEmpty( array $elements ) {
402
		$arrayObject = new Diff( $elements );
403
404
		$this->assertEquals( $elements === array(), $arrayObject->isEmpty() );
405
	}
406
407
	/**
408
	 * @dataProvider instanceProvider
409
	 *
410
	 * @since 0.6
411
	 *
412
	 * @param Diff $list
413
	 */
414
	public function testUnset( Diff $list ) {
415
		if ( $list->isEmpty() ) {
416
			$this->assertTrue( true ); // We cannot test unset if there are no elements
417
		} else {
418
			$offset = $list->getIterator()->key();
419
			$count = $list->count();
420
			$list->offsetUnset( $offset );
421
			$this->assertEquals( $count - 1, $list->count() );
422
		}
423
424
		if ( !$list->isEmpty() ) {
425
			$offset = $list->getIterator()->key();
426
			$count = $list->count();
427
			unset( $list[$offset] );
428
			$this->assertEquals( $count - 1, $list->count() );
429
		}
430
	}
431
432
	/**
433
	 * @dataProvider elementInstancesProvider
434
	 *
435
	 * @since 0.6
436
	 *
437
	 * @param DiffOp[] $elements
438
	 */
439
	public function testAppend( array $elements ) {
440
		$list = new Diff();
441
442
		$listSize = count( $elements );
443
444
		foreach ( $elements as $element ) {
445
			$list->append( $element );
446
		}
447
448
		$this->assertEquals( $listSize, $list->count() );
449
450
		$list = new Diff();
451
452
		foreach ( $elements as $element ) {
453
			$list[] = $element;
454
		}
455
456
		$this->assertEquals( $listSize, $list->count() );
457
458
		$this->checkTypeChecks( function ( Diff $list, $element ) {
459
			$list->append( $element );
460
		} );
461
	}
462
463
	/**
464
	 * @param callback $function
465
	 */
466
	private function checkTypeChecks( $function ) {
467
		$excption = null;
0 ignored issues
show
$excption is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
468
		$list = new Diff();
469
470
471
		foreach ( array( 42, 'foo', array(), new stdClass(), 4.2 ) as $element ) {
472
			$this->assertInvalidArgument( $function, $list, $element );
473
		}
474
	}
475
476
	/**
477
	 * Asserts that an InvalidArgumentException gets thrown when calling the provided
478
	 * callable. Extra arguments specified to the method are also provided to the callable.
479
	 *
480
	 * @param callable $function
481
	 */
482
	private function assertInvalidArgument( $function ) {
483
		$this->setExpectedException( 'InvalidArgumentException' );
484
485
		$arguments = func_get_args();
486
		array_shift( $arguments );
487
488
		call_user_func_array( $function, $arguments );
489
	}
490
491
	public function testGetAddedValues() {
492
		$diff = new Diff( array(
493
			new DiffOpAdd( 0 ),
494
			new DiffOpRemove( 1 ),
495
			new DiffOpAdd( 2 ),
496
			new DiffOpRemove( 3 ),
497
			new DiffOpAdd( 4 ),
498
			new DiffOpChange( 7, 5 ),
499
			new Diff( array( new DiffOpAdd( 9 ) ) ),
500
		) );
501
502
		$addedValues = $diff->getAddedValues();
503
504
		$this->assertInternalType( 'array', $addedValues );
505
506
		$this->assertArrayEquals( array( 0, 2, 4 ), $addedValues );
507
508
		$diff = new Diff();
509
		$this->assertArrayEquals( array(), $diff->getAddedValues() );
510
	}
511
512
	public function testGetRemovedValues() {
513
		$diff = new Diff( array(
514
			new DiffOpAdd( 0 ),
515
			new DiffOpRemove( 1 ),
516
			new DiffOpAdd( 2 ),
517
			new DiffOpRemove( 3 ),
518
			new DiffOpAdd( 4 ),
519
			new DiffOpChange( 6, 4 ),
520
			new Diff( array( new DiffOPRemove( 8 ) ) ),
521
		) );
522
523
		$removedValues = $diff->getRemovedValues();
524
525
		$this->assertInternalType( 'array', $removedValues );
526
527
		$this->assertArrayEquals( array( 1, 3 ), $removedValues );
528
529
		$diff = new Diff();
530
		$this->assertArrayEquals( array(), $diff->getRemovedValues() );
531
	}
532
533
	/**
534
	 * @dataProvider elementInstancesProvider
535
	 *
536
	 * @since 0.6
537
	 *
538
	 * @param DiffOp[] $elements
539
	 */
540
	public function testOffsetSet( array $elements ) {
541
		if ( $elements === array() ) {
542
			$this->assertTrue( true );
543
			return;
544
		}
545
546
		$list = new Diff();
547
548
		$element = reset( $elements );
549
		$list->offsetSet( 42, $element );
550
		$this->assertEquals( $element, $list->offsetGet( 42 ) );
551
552
		$list = new Diff();
553
554
		$element = reset( $elements );
555
		$list['oHai'] = $element;
556
		$this->assertEquals( $element, $list['oHai'] );
557
558
		$list = new Diff();
559
560
		$element = reset( $elements );
561
		$list->offsetSet( 9001, $element );
562
		$this->assertEquals( $element, $list[9001] );
563
564
		$list = new Diff();
565
566
		$element = reset( $elements );
567
		$list->offsetSet( null, $element );
568
		$this->assertEquals( $element, $list[0] );
569
570
		$list = new Diff();
571
		$offset = 0;
572
573
		foreach ( $elements as $element ) {
574
			$list->offsetSet( null, $element );
575
			$this->assertEquals( $element, $list[$offset++] );
576
		}
577
578
		$this->assertEquals( count( $elements ), $list->count() );
579
580
		$this->checkTypeChecks( function ( Diff $list, $element ) {
581
			$list->offsetSet( mt_rand(), $element );
582
		} );
583
	}
584
585
	/**
586
	 * @dataProvider instanceProvider
587
	 *
588
	 * @since 0.6
589
	 *
590
	 * @param Diff $list
591
	 */
592
	public function testSerialization( Diff $list ) {
593
		$serialization = serialize( $list );
594
		$copy = unserialize( $serialization );
595
596
		$this->assertSame( $serialization, serialize( $copy ) );
597
		$this->assertSame( $list->count(), $copy->count() );
598
599
		$list = $list->getArrayCopy();
600
		$copy = $copy->getArrayCopy();
601
602
		$this->assertArrayEquals( $list, $copy, true, true );
603
	}
604
605
	/**
606
	 * @dataProvider instanceProvider
607
	 *
608
	 * @since 0.6
609
	 *
610
	 * @param Diff $list
611
	 */
612
	public function testAddInvalidDiffOp( Diff $list ) {
613
		$invalidDiffOp = $this->getMock( 'Diff\DiffOp\DiffOp' );
614
615
		$invalidDiffOp->expects( $this->atLeastOnce() )
616
			->method( 'getType' )
617
			->will( $this->returnValue( '~=[,,_,,]:3' ) );
618
619
		$this->setExpectedException( 'Exception' );
620
621
		$list->append( $invalidDiffOp );
622
	}
623
624
	/**
625
	 * @dataProvider invalidIsAssociativeProvider
626
	 */
627
	public function testConstructWithInvalidIsAssociative( $isAssociative ) {
628
		$this->setExpectedException( 'InvalidArgumentException' );
629
		new Diff( array(), $isAssociative );
630
	}
631
632
	public function invalidIsAssociativeProvider() {
633
		return $this->arrayWrap( array(
634
			1,
635
			'1',
636
			'null',
637
			0,
638
			array(),
639
			'foobar'
640
		) );
641
	}
642
643
	/**
644
	 * @dataProvider invalidDiffOpsProvider
645
	 */
646
	public function testConstructorWithInvalidDiffOps( array $diffOps ) {
647
		$this->setExpectedException( 'InvalidArgumentException' );
648
		new Diff( $diffOps );
649
	}
650
651
	public function invalidDiffOpsProvider() {
652
		$diffOpLists = array();
653
654
		$diffOpLists[] = array(
655
			'foo'
656
		);
657
658
		$diffOpLists[] = array(
659
			null
660
		);
661
662
		$diffOpLists[] = array(
663
			false,
664
			true,
665
			array()
666
		);
667
668
		$diffOpLists[] = array(
669
			new DiffOpAdd( 42 ),
670
			'in your list',
671
			new DiffOpAdd( 9001 ),
672
		);
673
674
		return $this->arrayWrap( $diffOpLists );
675
	}
676
677
	/**
678
	 * @dataProvider equalsProvider
679
	 */
680
	public function testEquals( Diff $diff, Diff $target ) {
681
		$this->assertTrue( $diff->equals( $target ) );
682
		$this->assertTrue( $target->equals( $diff ) );
683
	}
684
685
	public function equalsProvider() {
686
		return array(
687
			// Empty diffs
688
			array( new Diff(), new Diff() ),
689
			array( new Diff(), new Diff( array(), null ) ),
690
691
			// Simple diffs
692
			array( new Diff( array( new DiffOpAdd( 1 ) ) ), new Diff( array( new DiffOpAdd( 1 ) ) ) ),
693
			array( new Diff( array( new DiffOpAdd( 1 ) ) ), new Diff( array( new DiffOpAdd( '1' ) ) ) ),
694
695
			// Subclasses that are shortcuts and should be equal
696
			array( new Diff( array(), false ), new ListDiff() ),
0 ignored issues
show
Deprecated Code introduced by
The class Diff\DiffOp\Diff\ListDiff has been deprecated with message: since 0.5, just use Diff instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
697
			array( new Diff( array(), true ), new MapDiff() ),
0 ignored issues
show
Deprecated Code introduced by
The class Diff\DiffOp\Diff\MapDiff has been deprecated with message: since 0.5, just use Diff instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
698
		);
699
	}
700
701
	/**
702
	 * @dataProvider notEqualsProvider
703
	 */
704
	public function testNotEquals( Diff $diff, Diff $target ) {
705
		$this->assertFalse( $diff->equals( $target ) );
706
		$this->assertFalse( $target->equals( $diff ) );
707
	}
708
709
	public function notEqualsProvider() {
710
		return array(
711
			// Empty diffs
712
			array( new Diff(), new Diff( array(), false ) ),
713
			array( new Diff(), new Diff( array(), true ) ),
714
715
			// Simple diffs
716
			array( new Diff(), new Diff( array( new DiffOpAdd( 1 ) ) ) ),
717
			array( new Diff( array( new DiffOpAdd( 1 ) ) ), new Diff( array( new DiffOpRemove( 1 ) ) ) ),
718
			array( new Diff( array( new DiffOpAdd( 1 ) ) ), new Diff( array( new DiffOpAdd( 2 ) ) ) ),
719
		);
720
	}
721
722
}
723