/**
* @group ContentHandler
+ *
+ * @group Database
+ * ^--- needed, because we do need the database to test link updates
*/
-class JavascriptContentTest extends WikitextContentTest {
+class JavascriptContentTest extends TextContentTest {
public function newContent( $text ) {
return new JavascriptContent( $text );
public function dataGetParserOutput() {
return array(
- array("MediaWiki:Test.js", "hello <world>\n",
- "<pre class=\"mw-code mw-js\" dir=\"ltr\">\nhello <world>\n\n</pre>\n"),
+ array("MediaWiki:Test.js", null, "hello <world>\n",
+ "<pre class=\"mw-code mw-js\" dir=\"ltr\">\nhello <world>\n\n</pre>"),
// @todo: more...?
);
}
}
// XXX: currently, preSaveTransform is applied to scripts. this may change or become optional.
- /*
public function dataPreSaveTransform() {
return array(
array( 'hello this is ~~~',
- "hello this is ~~~",
+ "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
),
array( 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
- 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
+ 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
),
);
}
- */
public function dataPreloadTransform() {
return array(
$this->assertFalse( $content->matchMagicWord( $mw ), "should not have matched magic word, since it's not wikitext" );
}
+ public function testUpdateRedirect( ) {
+ $target = Title::newFromText( "testUpdateRedirect_target" );
+
+ $content = $this->newContent( "#REDIRECT [[Someplace]]" );
+ $newContent = $content->updateRedirect( $target );
+
+ $this->assertTrue( $content->equals( $newContent ), "content should be unchanged since it's not wikitext" );
+ }
+
# =================================================================================================================
public function testGetModel() {