Use setContentLang() instead of setMwGlobals()
[lhc/web/wiklou.git] / tests / phpunit / includes / EditPageTest.php
index 7cf24bf..036b618 100644 (file)
@@ -16,11 +16,12 @@ class EditPageTest extends MediaWikiLangTestCase {
 
                parent::setUp();
 
+               $this->setContentLang( $wgContLang );
+
                $this->setMwGlobals( [
                        'wgExtraNamespaces' => $wgExtraNamespaces,
                        'wgNamespaceContentModels' => $wgNamespaceContentModels,
                        'wgContentHandlers' => $wgContentHandlers,
-                       'wgContLang' => $wgContLang,
                ] );
 
                $wgExtraNamespaces[12312] = 'Dummy';
@@ -173,6 +174,10 @@ class EditPageTest extends MediaWikiLangTestCase {
                        $edit['wpStarttime'] = wfTimestampNow();
                }
 
+               if ( !isset( $edit['wpUnicodeCheck'] ) ) {
+                       $edit['wpUnicodeCheck'] = EditPage::UNICODE_CHECK;
+               }
+
                $req = new FauxRequest( $edit, true ); // session ??
 
                $article = new Article( $title );
@@ -705,14 +710,15 @@ hello
                        'wpTextbox1' => serialize( 'non-text content' ),
                        'wpEditToken' => $user->getEditToken(),
                        'wpEdittime' => '',
-                       'wpStarttime' => wfTimestampNow()
+                       'wpStarttime' => wfTimestampNow(),
+                       'wpUnicodeCheck' => EditPage::UNICODE_CHECK,
                ];
 
                $req = new FauxRequest( $edit, true );
                $ep->importFormData( $req );
 
                $this->setExpectedException(
-                       'MWException',
+                       MWException::class,
                        'This content model is not supported: testing'
                );