25 'wgLanguageCode' =>
'en',
29 $this->tablesUsed[] =
'page';
30 $this->tablesUsed[] =
'revision';
31 $this->tablesUsed[] =
'text';
35 $this->talk_namespace =
NS_TALK;
37 if ( $this->
namespace === $this->talk_namespace ) {
39 throw new MWException(
"The default wikitext namespace is the talk namespace. "
40 .
" We can't currently deal with that." );
46 "BackupDumperTestP1Text1",
"BackupDumperTestP1Summary1" );
47 $this->pageId1 = $page->getId();
52 "BackupDumperTestP2Text1",
"BackupDumperTestP2Summary1" );
54 "BackupDumperTestP2Text2",
"BackupDumperTestP2Summary2" );
56 "BackupDumperTestP2Text3",
"BackupDumperTestP2Summary3" );
58 "BackupDumperTestP2Text4 some additional Text ",
59 "BackupDumperTestP2Summary4 extra " );
60 $this->pageId2 = $page->getId();
65 "BackupDumperTestP3Text1",
"BackupDumperTestP2Summary1" );
67 "BackupDumperTestP3Text2",
"BackupDumperTestP2Summary2" );
68 $this->pageId3 = $page->getId();
69 $page->doDeleteArticle(
"Testing ;)" );
74 "Talk about BackupDumperTestP1 Text1",
75 "Talk BackupDumperTestP1 Summary1" );
76 $this->pageId4 = $page->getId();
77 }
catch ( Exception
$e ) {
81 $this->exceptionFromAddDBData =
$e;
93 array( $this->pageId2, $this->pageId3, $this->pageId4 ),
94 array( $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ),
95 "Page ids increasing without holes" );
103 $dumper->endId = $this->pageId4 + 1;
114 $this->
assertPageStart( $this->pageId1, $this->
namespace, $this->pageTitle1->getPrefixedText() );
115 $this->
assertRevision( $this->revId1_1,
"BackupDumperTestP1Summary1",
116 $this->textId1_1, 23,
"0bolhl6ol7i6x0e7yq91gxgaan39j87",
117 "BackupDumperTestP1Text1" );
121 $this->
assertPageStart( $this->pageId2, $this->
namespace, $this->pageTitle2->getPrefixedText() );
122 $this->
assertRevision( $this->revId2_1,
"BackupDumperTestP2Summary1",
123 $this->textId2_1, 23,
"jprywrymfhysqllua29tj3sc7z39dl2",
124 "BackupDumperTestP2Text1" );
125 $this->
assertRevision( $this->revId2_2,
"BackupDumperTestP2Summary2",
126 $this->textId2_2, 23,
"b7vj5ks32po5m1z1t1br4o7scdwwy95",
127 "BackupDumperTestP2Text2", $this->revId2_1 );
128 $this->
assertRevision( $this->revId2_3,
"BackupDumperTestP2Summary3",
129 $this->textId2_3, 23,
"jfunqmh1ssfb8rs43r19w98k28gg56r",
130 "BackupDumperTestP2Text3", $this->revId2_2 );
131 $this->
assertRevision( $this->revId2_4,
"BackupDumperTestP2Summary4 extra",
132 $this->textId2_4, 44,
"6o1ciaxa6pybnqprmungwofc4lv00wv",
133 "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 );
140 $this->
assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() );
141 $this->
assertRevision( $this->revId4_1,
"Talk BackupDumperTestP1 Summary1",
142 $this->textId4_1, 35,
"nktofwzd0tl192k3zfepmlzxoax1lpe",
143 "Talk about BackupDumperTestP1 Text1" );
154 $dumper->endId = $this->pageId4 + 1;
165 $this->
assertPageStart( $this->pageId1, $this->
namespace, $this->pageTitle1->getPrefixedText() );
166 $this->
assertRevision( $this->revId1_1,
"BackupDumperTestP1Summary1",
167 $this->textId1_1, 23,
"0bolhl6ol7i6x0e7yq91gxgaan39j87" );
171 $this->
assertPageStart( $this->pageId2, $this->
namespace, $this->pageTitle2->getPrefixedText() );
172 $this->
assertRevision( $this->revId2_1,
"BackupDumperTestP2Summary1",
173 $this->textId2_1, 23,
"jprywrymfhysqllua29tj3sc7z39dl2" );
174 $this->
assertRevision( $this->revId2_2,
"BackupDumperTestP2Summary2",
175 $this->textId2_2, 23,
"b7vj5ks32po5m1z1t1br4o7scdwwy95",
false, $this->revId2_1 );
176 $this->
assertRevision( $this->revId2_3,
"BackupDumperTestP2Summary3",
177 $this->textId2_3, 23,
"jfunqmh1ssfb8rs43r19w98k28gg56r",
false, $this->revId2_2 );
178 $this->
assertRevision( $this->revId2_4,
"BackupDumperTestP2Summary4 extra",
179 $this->textId2_4, 44,
"6o1ciaxa6pybnqprmungwofc4lv00wv",
false, $this->revId2_3 );
186 $this->
assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() );
187 $this->
assertRevision( $this->revId4_1,
"Talk BackupDumperTestP1 Summary1",
188 $this->textId4_1, 35,
"nktofwzd0tl192k3zfepmlzxoax1lpe" );
199 $dumper->endId = $this->pageId4 + 1;
210 $this->
assertPageStart( $this->pageId1, $this->
namespace, $this->pageTitle1->getPrefixedText() );
211 $this->
assertRevision( $this->revId1_1,
"BackupDumperTestP1Summary1",
212 $this->textId1_1, 23,
"0bolhl6ol7i6x0e7yq91gxgaan39j87" );
216 $this->
assertPageStart( $this->pageId2, $this->
namespace, $this->pageTitle2->getPrefixedText() );
217 $this->
assertRevision( $this->revId2_4,
"BackupDumperTestP2Summary4 extra",
218 $this->textId2_4, 44,
"6o1ciaxa6pybnqprmungwofc4lv00wv",
false, $this->revId2_3 );
225 $this->
assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() );
226 $this->
assertRevision( $this->revId4_1,
"Talk BackupDumperTestP1 Summary1",
227 $this->textId4_1, 35,
"nktofwzd0tl192k3zfepmlzxoax1lpe" );
240 $dumper->endId = $this->pageId4 + 1;
252 $this->
assertPageStart( $this->pageId1, $this->
namespace, $this->pageTitle1->getPrefixedText() );
253 $this->
assertRevision( $this->revId1_1,
"BackupDumperTestP1Summary1",
254 $this->textId1_1, 23,
"0bolhl6ol7i6x0e7yq91gxgaan39j87" );
258 $this->
assertPageStart( $this->pageId2, $this->
namespace, $this->pageTitle2->getPrefixedText() );
259 $this->
assertRevision( $this->revId2_4,
"BackupDumperTestP2Summary4 extra",
260 $this->textId2_4, 44,
"6o1ciaxa6pybnqprmungwofc4lv00wv",
false, $this->revId2_3 );
267 $this->
assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() );
268 $this->
assertRevision( $this->revId4_1,
"Talk BackupDumperTestP1 Summary1",
269 $this->textId4_1, 35,
"nktofwzd0tl192k3zfepmlzxoax1lpe" );
293 "--output=gzip:" . $fnameMetaCurrent,
"--filter=latest",
294 "--output=gzip:" . $fnameArticles,
"--filter=latest",
295 "--filter=notalk",
"--filter=namespace:!NS_USER",
296 "--reporting=1000" ) );
298 $dumper->endId = $this->pageId4 + 1;
305 $dumper->stderr = fopen(
'php://output',
'a' );
306 if (
$dumper->stderr ===
false ) {
307 $this->
fail(
"Could not open stream for stderr" );
313 $this->assertTrue( fclose(
$dumper->stderr ),
"Closing stderr handle" );
317 $this->
gunzip( $fnameMetaHistory );
321 $this->
assertPageStart( $this->pageId1, $this->
namespace, $this->pageTitle1->getPrefixedText() );
322 $this->
assertRevision( $this->revId1_1,
"BackupDumperTestP1Summary1",
323 $this->textId1_1, 23,
"0bolhl6ol7i6x0e7yq91gxgaan39j87" );
327 $this->
assertPageStart( $this->pageId2, $this->
namespace, $this->pageTitle2->getPrefixedText() );
328 $this->
assertRevision( $this->revId2_1,
"BackupDumperTestP2Summary1",
329 $this->textId2_1, 23,
"jprywrymfhysqllua29tj3sc7z39dl2" );
330 $this->
assertRevision( $this->revId2_2,
"BackupDumperTestP2Summary2",
331 $this->textId2_2, 23,
"b7vj5ks32po5m1z1t1br4o7scdwwy95",
false, $this->revId2_1 );
332 $this->
assertRevision( $this->revId2_3,
"BackupDumperTestP2Summary3",
333 $this->textId2_3, 23,
"jfunqmh1ssfb8rs43r19w98k28gg56r",
false, $this->revId2_2 );
334 $this->
assertRevision( $this->revId2_4,
"BackupDumperTestP2Summary4 extra",
335 $this->textId2_4, 44,
"6o1ciaxa6pybnqprmungwofc4lv00wv",
false, $this->revId2_3 );
342 $this->
assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() );
343 $this->
assertRevision( $this->revId4_1,
"Talk BackupDumperTestP1 Summary1",
344 $this->textId4_1, 35,
"nktofwzd0tl192k3zfepmlzxoax1lpe" );
351 $this->
gunzip( $fnameMetaCurrent );
355 $this->
assertPageStart( $this->pageId1, $this->
namespace, $this->pageTitle1->getPrefixedText() );
356 $this->
assertRevision( $this->revId1_1,
"BackupDumperTestP1Summary1",
357 $this->textId1_1, 23,
"0bolhl6ol7i6x0e7yq91gxgaan39j87" );
361 $this->
assertPageStart( $this->pageId2, $this->
namespace, $this->pageTitle2->getPrefixedText() );
362 $this->
assertRevision( $this->revId2_4,
"BackupDumperTestP2Summary4 extra",
363 $this->textId2_4, 44,
"6o1ciaxa6pybnqprmungwofc4lv00wv",
false, $this->revId2_3 );
370 $this->
assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() );
371 $this->
assertRevision( $this->revId4_1,
"Talk BackupDumperTestP1 Summary1",
372 $this->textId4_1, 35,
"nktofwzd0tl192k3zfepmlzxoax1lpe" );
379 $this->
gunzip( $fnameArticles );
383 $this->
assertPageStart( $this->pageId1, $this->
namespace, $this->pageTitle1->getPrefixedText() );
384 $this->
assertRevision( $this->revId1_1,
"BackupDumperTestP1Summary1",
385 $this->textId1_1, 23,
"0bolhl6ol7i6x0e7yq91gxgaan39j87" );
389 $this->
assertPageStart( $this->pageId2, $this->
namespace, $this->pageTitle2->getPrefixedText() );
390 $this->
assertRevision( $this->revId2_4,
"BackupDumperTestP2Summary4 extra",
391 $this->textId2_4, 44,
"6o1ciaxa6pybnqprmungwofc4lv00wv",
false, $this->revId2_3 );