Add part to update ctd_user_defined in populateChangeTagDef
[lhc/web/wiklou.git] / tests / phpunit / includes / content / TextContentTest.php
index 1601493..b01a7db 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * @group ContentHandler
  * @group Database
@@ -115,9 +117,8 @@ class TextContentTest extends MediaWikiLangTestCase {
         * @covers TextContent::preSaveTransform
         */
        public function testPreSaveTransform( $text, $expected ) {
-               global $wgContLang;
-
-               $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang );
+               $options = ParserOptions::newFromUserAndLang( $this->context->getUser(),
+                       MediaWikiServices::getInstance()->getContentLanguage() );
 
                $content = $this->newContent( $text );
                $content = $content->preSaveTransform(
@@ -143,8 +144,8 @@ class TextContentTest extends MediaWikiLangTestCase {
         * @covers TextContent::preloadTransform
         */
        public function testPreloadTransform( $text, $expected ) {
-               global $wgContLang;
-               $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang );
+               $options = ParserOptions::newFromUserAndLang( $this->context->getUser(),
+                       MediaWikiServices::getInstance()->getContentLanguage() );
 
                $content = $this->newContent( $text );
                $content = $content->preloadTransform( $this->context->getTitle(), $options );
@@ -197,16 +198,6 @@ class TextContentTest extends MediaWikiLangTestCase {
                                'any',
                                true
                        ],
-                       [ 'Foo',
-                               null,
-                               'comma',
-                               false
-                       ],
-                       [ 'Foo, bar',
-                               null,
-                               'comma',
-                               false
-                       ],
                ];
        }
 
@@ -454,7 +445,7 @@ class TextContentTest extends MediaWikiLangTestCase {
                if ( $expectedNative === false ) {
                        $this->assertFalse( $converted, "conversion to $model was expected to fail!" );
                } else {
-                       $this->assertInstanceOf( 'Content', $converted );
+                       $this->assertInstanceOf( Content::class, $converted );
                        $this->assertEquals( $expectedNative, $converted->getNativeData() );
                }
        }