25 $this->context->setTitle(
$title );
27 if ( !self::$revisions ) {
28 self::$revisions = $this->
doEdits();
47 $strings = [
"it is a kitten",
"two kittens",
"three kittens",
"four kittens" ];
50 foreach ( $strings
as $string ) {
52 $page->doEditContent( $content,
'edit page' );
62 foreach ( $cases
as $case ) {
63 list( $expected, $old, $new, $message ) = $case;
65 $diffEngine =
new DifferenceEngine( $this->context, $old, $new, 2,
true,
false );
66 $diffMap = $diffEngine->mapDiffPrevNext( $old, $new );
67 $this->assertEquals( $expected, $diffMap, $message );
75 [ [ $revs[1], $revs[2] ], $revs[2],
'prev',
'diff=prev' ],
76 [ [ $revs[2], $revs[3] ], $revs[2],
'next',
'diff=next' ],
77 [ [ $revs[1], $revs[3] ], $revs[1], $revs[3],
'diff=' . $revs[3] ]
84 foreach ( $cases
as $case ) {
85 list( $expectedOld, $expectedNew, $old, $new, $message ) = $case;
87 $diffEngine =
new DifferenceEngine( $this->context, $old, $new, 2,
true,
false );
88 $diffEngine->loadRevisionData();
90 $this->assertEquals( $diffEngine->getOldid(), $expectedOld, $message );
91 $this->assertEquals( $diffEngine->getNewid(), $expectedNew, $message );
99 [ $revs[2], $revs[3], $revs[3],
'prev',
'diff=prev' ],
100 [ $revs[2], $revs[3], $revs[2],
'next',
'diff=next' ],
101 [ $revs[1], $revs[3], $revs[1], $revs[3],
'diff=' . $revs[3] ],
102 [ $revs[1], $revs[3], $revs[1], 0,
'diff=0' ]
109 $diffEngine =
new DifferenceEngine( $this->context, $revs[1], $revs[2], 2,
true,
false );
110 $this->assertEquals( $revs[1], $diffEngine->getOldid(),
'diff get old id' );
116 $diffEngine =
new DifferenceEngine( $this->context, $revs[1], $revs[2], 2,
true,
false );
117 $this->assertEquals( $revs[2], $diffEngine->getNewid(),
'diff get new id' );