<?php
+use MediaWiki\MediaWikiServices;
+
/**
* @group ContentHandler
*
* @covers WikitextContent::matchMagicWord
*/
public function testMatchMagicWord() {
- $mw = MagicWord::get( "staticredirect" );
+ $mw = MediaWikiServices::getInstance()->getMagicWordFactory()->get( "staticredirect" );
$content = $this->newContent( "#REDIRECT [[FOO]]\n__STATICREDIRECT__" );
$this->assertTrue( $content->matchMagicWord( $mw ), "should have matched magic word" );
public static function dataGetDeletionUpdates() {
return [
- [ "WikitextContentTest_testGetSecondaryDataUpdates_1",
+ [
CONTENT_MODEL_WIKITEXT, "hello ''world''\n",
[ LinksDeletionUpdate::class => [] ]
],
- [ "WikitextContentTest_testGetSecondaryDataUpdates_2",
+ [
CONTENT_MODEL_WIKITEXT, "hello [[world test 21344]]\n",
[ LinksDeletionUpdate::class => [] ]
],
// @todo more...?
];
}
+
+ /**
+ * @covers WikitextContent::preSaveTransform
+ * @covers WikitextContent::fillParserOutput
+ */
+ public function testHadSignature() {
+ $titleObj = Title::newFromText( __CLASS__ );
+
+ $content = new WikitextContent( '~~~~' );
+ $pstContent = $content->preSaveTransform(
+ $titleObj, $this->getTestUser()->getUser(), new ParserOptions()
+ );
+
+ $this->assertTrue( $pstContent->getParserOutput( $titleObj )->getFlag( 'user-signature' ) );
+ }
}