24 if ( $this->dump !==
null ) {
41 $this->assertEquals( $expected, $this->dump->prefetch( $page, $revision ),
42 "Prefetch of page $page revision $revision" );
117 $this->dump =
new BaseDump( $fname1 .
";" . $fname2 );
129 $this->dump =
new BaseDump( $fname1 .
";" . $fname2 .
";" . $fname3 );
138 $this->dump =
new BaseDump( $fname1 .
";" . $fname2 );
158 $header =
'<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.7/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.7/ http://www.mediawiki.org/xml/export-0.7.xsd" version="0.7" xml:lang="en">
160 <sitename>wikisvn</sitename>
161 <base>http://localhost/wiki-svn/index.php/Main_Page</base>
162 <generator>MediaWiki 1.21alpha</generator>
163 <case>first-letter</case>
165 <namespace key="-2" case="first-letter">Media</namespace>
166 <namespace key="-1" case="first-letter">Special</namespace>
167 <namespace key="0" case="first-letter" />
168 <namespace key="1" case="first-letter">Talk</namespace>
169 <namespace key="2" case="first-letter">User</namespace>
170 <namespace key="3" case="first-letter">User talk</namespace>
171 <namespace key="4" case="first-letter">Wikisvn</namespace>
172 <namespace key="5" case="first-letter">Wikisvn talk</namespace>
173 <namespace key="6" case="first-letter">File</namespace>
174 <namespace key="7" case="first-letter">File talk</namespace>
175 <namespace key="8" case="first-letter">MediaWiki</namespace>
176 <namespace key="9" case="first-letter">MediaWiki talk</namespace>
177 <namespace key="10" case="first-letter">Template</namespace>
178 <namespace key="11" case="first-letter">Template talk</namespace>
179 <namespace key="12" case="first-letter">Help</namespace>
180 <namespace key="13" case="first-letter">Help talk</namespace>
181 <namespace key="14" case="first-letter">Category</namespace>
182 <namespace key="15" case="first-letter">Category talk</namespace>
188 $available_pages = [];
191 $available_pages[1] =
' <page>
192 <title>BackupDumperTestP1</title>
197 <timestamp>2012-04-01T16:46:05Z</timestamp>
201 <comment>BackupDumperTestP1Summary1</comment>
202 <sha1>0bolhl6ol7i6x0e7yq91gxgaan39j87</sha1>
203 <text xml:space="preserve">BackupDumperTestP1Text1</text>
204 <model name="wikitext">1</model>
205 <format mime="text/x-wiki">1</format>
210 $available_pages[2] =
' <page>
211 <title>BackupDumperTestP2</title>
216 <timestamp>2012-04-01T16:46:05Z</timestamp>
220 <comment>BackupDumperTestP2Summary1</comment>
221 <sha1>jprywrymfhysqllua29tj3sc7z39dl2</sha1>
222 <text xml:space="preserve">BackupDumperTestP2Text1</text>
223 <model name="wikitext">1</model>
224 <format mime="text/x-wiki">1</format>
228 <parentid>2</parentid>
229 <timestamp>2012-04-01T16:46:05Z</timestamp>
233 <comment>BackupDumperTestP2Summary4 extra</comment>
234 <sha1>6o1ciaxa6pybnqprmungwofc4lv00wv</sha1>
235 <text xml:space="preserve">BackupDumperTestP2Text4 some additional Text</text>
236 <model name="wikitext">1</model>
237 <format mime="text/x-wiki">1</format>
242 $available_pages[4] =
' <page>
243 <title>Talk:BackupDumperTestP1</title>
248 <timestamp>2012-04-01T16:46:05Z</timestamp>
252 <comment>Talk BackupDumperTestP1 Summary1</comment>
253 <sha1>nktofwzd0tl192k3zfepmlzxoax1lpe</sha1>
254 <model name="wikitext">1</model>
255 <format mime="text/x-wiki">1</format>
256 <text xml:space="preserve">Talk about BackupDumperTestP1 Text1</text>
262 $tail =
'</mediawiki>
267 foreach ( $requested_pages as $i ) {
268 $this->assertTrue( array_key_exists( $i, $available_pages ),
269 "Check for availability of requested page " . $i );
270 $content .= $available_pages[$i];
274 $this->assertEquals( strlen( $content ), file_put_contents(
275 $fname, $content ),
"Length of prepared prefetch" );
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
Readahead helper for making large MediaWiki data dumps; reads in a previous XML dump to sequentially ...
testSynchronizeSkipAcrossFile()
testSynchronizeRevisionMissToPage()
testSynchronizePageMiss()
testSynchronizeMissInWholeFirstFile()
testSequentialAcrossFiles()
BaseDump $dump
The BaseDump instance used within a test.
testSynchronizeRevisionMissToRevision()
testSynchronizePageMissAtStart()
assertPrefetchEquals( $expected, $page, $revision)
asserts that a prefetch yields an expected string
setUpPrefetch( $requested_pages=[1, 2, 4])
Constructs a temporary file that can be used for prefetching.
testSynchronizeRevisionMissAtStart()