$this->tablesUsed[] = 'revision';
$this->tablesUsed[] = 'text';
+ $this->mergeMwGlobalArrayValue( 'wgContentHandlers', array(
+ "BackupTextPassTestModel" => "BackupTextPassTestModelHandler"
+ ) );
+
$ns = $this->getDefaultWikitextNS();
try {
$this->pageId3 = $page->getId();
$page->doDeleteArticle( "Testing ;)" );
- // Page from non-default namespace
+ // Page from non-default namespace and model.
+ // ExportTransform applies.
if ( $ns === NS_TALK ) {
// @todo work around this.
$page = WikiPage::factory( $title );
list( $this->revId4_1, $this->textId4_1 ) = $this->addRevision( $page,
"Talk about BackupDumperTestP1 Text1",
- "Talk BackupDumperTestP1 Summary1" );
+ "Talk BackupDumperTestP1 Summary1",
+ "BackupTextPassTestModel" );
$this->pageId4 = $page->getId();
} catch ( Exception $e ) {
// We'd love to pass $e directly. However, ... see
$this->assertPageStart( $this->pageId4, NS_TALK, "Talk:BackupDumperTestP1" );
$this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
$this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe",
- "Talk about BackupDumperTestP1 Text1" );
+ "TALK ABOUT BACKUPDUMPERTESTP1 TEXT1",
+ false,
+ "BackupTextPassTestModel",
+ "text/plain" );
$this->assertPageEnd();
$this->assertDumpEnd();
$this->assertPageStart( $this->pageId4, NS_TALK, "Talk:BackupDumperTestP1" );
$this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
$this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe",
- "Talk about BackupDumperTestP1 Text1" );
+ "TALK ABOUT BACKUPDUMPERTESTP1 TEXT1",
+ false,
+ "BackupTextPassTestModel",
+ "text/plain" );
$this->assertPageEnd();
$this->assertDumpEnd();
$this->assertRevision( $this->revId4_1 + $i * self::$numOfRevs,
"Talk BackupDumperTestP1 Summary1",
$this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe",
- "Talk about BackupDumperTestP1 Text1" );
+ "TALK ABOUT BACKUPDUMPERTESTP1 TEXT1",
+ false,
+ "BackupTextPassTestModel",
+ "text/plain" );
$this->assertPageEnd();
$lookingForPage = 1;
<ip>127.0.0.1</ip>
</contributor>
<comment>Talk BackupDumperTestP1 Summary1</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
+ <model>BackupTextPassTestModel</model>
+ <format>text/plain</format>
<text id="' . $this->textId4_1 . '" bytes="35" />
<sha1>nktofwzd0tl192k3zfepmlzxoax1lpe</sha1>
</revision>
return $fname;
}
}
+
+class BackupTextPassTestModelHandler extends TextContentHandler {
+
+ public function __construct() {
+ parent::__construct( 'BackupTextPassTestModel' );
+ }
+
+ public function exportTransform( $text, $format = null ) {
+ return strtoupper( $text );
+ }
+
+}
\ No newline at end of file