Merge "Add SPARQL client to core"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiEditPageTest.php
index 0ffcbca..7eac559 100644 (file)
@@ -36,14 +36,18 @@ class ApiEditPageTest extends ApiTestCase {
                $wgContentHandlers["testing"] = 'DummyContentHandlerForTesting';
                $wgContentHandlers["testing-nontext"] = 'DummyNonTextContentHandler';
 
-               MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache
+               MWNamespace::clearCaches();
                $wgContLang->resetNamespaces(); # reset namespace cache
 
                $this->doLogin();
        }
 
        protected function tearDown() {
-               MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache
+               global $wgContLang;
+
+               MWNamespace::clearCaches();
+               $wgContLang->resetNamespaces(); # reset namespace cache
+
                parent::tearDown();
        }
 
@@ -204,7 +208,7 @@ class ApiEditPageTest extends ApiTestCase {
        /**
         * Test action=edit&section=new
         * Run it twice so we test adding a new section on a
-        * page that doesn't exist (bug 52830) and one that
+        * page that doesn't exist (T54830) and one that
         * does exist
         */
        public function testEditNewSection() {
@@ -416,7 +420,7 @@ class ApiEditPageTest extends ApiTestCase {
                $count++;
 
                /*
-               * bug 41990: if the target page has a newer revision than the redirect, then editing the
+               * T43990: if the target page has a newer revision than the redirect, then editing the
                * redirect while specifying 'redirect' and *not* specifying 'basetimestamp' erroneously
                * caused an edit conflict to be detected.
                */
@@ -474,7 +478,7 @@ class ApiEditPageTest extends ApiTestCase {
 
        public function testCheckDirectApiEditingDisallowed_forNonTextContent() {
                $this->setExpectedException(
-                       'ApiUsageException',
+                       ApiUsageException::class,
                        'Direct editing via API is not supported for content model ' .
                                'testing used by Dummy:ApiEditPageTest_nonTextPageEdit'
                );