Merge "Delete autoload.ide.php"
[lhc/web/wiklou.git] / tests / phpunit / includes / content / WikitextContentHandlerTest.php
index 02f82f4..b4b2948 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * @group ContentHandler
  */
@@ -78,10 +80,9 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
         * @covers WikitextContentHandler::makeRedirectContent
         */
        public function testMakeRedirectContent( $title, $expected ) {
-               global $wgContLang;
-               $wgContLang->resetNamespaces();
+               MediaWikiServices::getInstance()->getContentLanguage()->resetNamespaces();
 
-               MagicWord::clearCache();
+               MediaWikiServices::getInstance()->resetServiceForTesting( 'MagicWordFactory' );
 
                if ( is_string( $title ) ) {
                        $title = Title::newFromText( $title );
@@ -335,28 +336,11 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
                $this->assertSame( $expected, $tag );
        }
 
-       /**
-        * @todo Text case requires database, should be done by a test class in the Database group
-        */
-       /*
-       public function testGetAutoDeleteReason( Title $title, &$hasHistory ) {}
-       */
-
-       /**
-        * @todo Text case requires database, should be done by a test class in the Database group
-        */
-       /*
-       public function testGetUndoContent( Revision $current, Revision $undo,
-               Revision $undoafter = null
-       ) {
-       }
-       */
-
        /**
         * @covers WikitextContentHandler::getDataForSearchIndex
         */
        public function testDataIndexFieldsFile() {
-               $mockEngine = $this->createMock( 'SearchEngine' );
+               $mockEngine = $this->createMock( SearchEngine::class );
                $title = Title::newFromText( 'Somefile.jpg', NS_FILE );
                $page = new WikiPage( $title );