$out .= " " . Xml::elementClean( 'comment', array(), strval( $row->rev_comment ) ) . "\n";
}
+ if ( $row->rev_sha1 && !( $row->rev_deleted & Revision::DELETED_TEXT ) ) {
+ $out .= " " . Xml::element('sha1', null, strval( $row->rev_sha1 ) ) . "\n";
+ } else {
+ $out .= " <sha1/>\n";
+ }
+
$text = '';
if ( $row->rev_deleted & Revision::DELETED_TEXT ) {
$out .= " " . Xml::element( 'text', array( 'deleted' => 'deleted' ) ) . "\n";
"" ) . "\n";
}
- if ( $row->rev_sha1 && !( $row->rev_deleted & Revision::DELETED_TEXT ) ) {
- $out .= " " . Xml::element('sha1', null, strval( $row->rev_sha1 ) ) . "\n";
- } else {
- $out .= " <sha1/>\n";
- }
-
wfRunHooks( 'XmlDumpWriterWriteRevision', array( &$this, &$out, $row, $text ) );
$out .= " </revision>\n";
$this->assertTextNode( "comment", $summary );
+ $this->assertTextNode( "sha1", $text_sha1 );
+
$this->assertNodeStart( "text", false );
if ( $text_bytes !== false ) {
$this->assertEquals( $this->xml->getAttribute( "bytes" ), $text_bytes,
"Attribute 'bytes' of revision " . $id );
}
-
if ( $text === false ) {
// Testing for a stub
$this->assertEquals( $this->xml->getAttribute( "id" ), $text_id,
$this->skipWhitespace();
}
- $this->assertTextNode( "sha1", $text_sha1 );
-
$this->assertNodeEnd( "revision" );
$this->skipWhitespace();
}
<ip>127.0.0.1</ip>
</contributor>
<comment>BackupDumperTestP1Summary1</comment>
- <text id="' . $this->textId1_1 . '" bytes="23" />
<sha1>0bolhl6ol7i6x0e7yq91gxgaan39j87</sha1>
+ <text id="' . $this->textId1_1 . '" bytes="23" />
</revision>
</page>
';
<ip>127.0.0.1</ip>
</contributor>
<comment>BackupDumperTestP2Summary1</comment>
- <text id="' . $this->textId2_1 . '" bytes="23" />
<sha1>jprywrymfhysqllua29tj3sc7z39dl2</sha1>
+ <text id="' . $this->textId2_1 . '" bytes="23" />
</revision>
<revision>
<id>' . $this->revId2_2 . '</id>
<ip>127.0.0.1</ip>
</contributor>
<comment>BackupDumperTestP2Summary2</comment>
- <text id="' . $this->textId2_2 . '" bytes="23" />
<sha1>b7vj5ks32po5m1z1t1br4o7scdwwy95</sha1>
+ <text id="' . $this->textId2_2 . '" bytes="23" />
</revision>
<revision>
<id>' . $this->revId2_3 . '</id>
<ip>127.0.0.1</ip>
</contributor>
<comment>BackupDumperTestP2Summary3</comment>
- <text id="' . $this->textId2_3 . '" bytes="23" />
<sha1>jfunqmh1ssfb8rs43r19w98k28gg56r</sha1>
+ <text id="' . $this->textId2_3 . '" bytes="23" />
</revision>
<revision>
<id>' . $this->revId2_4 . '</id>
<ip>127.0.0.1</ip>
</contributor>
<comment>BackupDumperTestP2Summary4 extra</comment>
- <text id="' . $this->textId2_4 . '" bytes="44" />
<sha1>6o1ciaxa6pybnqprmungwofc4lv00wv</sha1>
+ <text id="' . $this->textId2_4 . '" bytes="44" />
</revision>
</page>
';
<ip>127.0.0.1</ip>
</contributor>
<comment>Talk BackupDumperTestP1 Summary1</comment>
- <text id="' . $this->textId4_1 . '" bytes="35" />
<sha1>nktofwzd0tl192k3zfepmlzxoax1lpe</sha1>
+ <text id="' . $this->textId4_1 . '" bytes="35" />
</revision>
</page>
';