Set title on context in ApiDocumentationTest
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 2 Feb 2016 14:27:05 +0000 (09:27 -0500)
committerHashar <hashar@free.fr>
Wed, 3 Feb 2016 12:16:54 +0000 (12:16 +0000)
For some reason the unit testing infrastructure doesn't set one, and
that makes RequestContext warn.

Bug: T125491
Change-Id: I3e0ec0f567dd06231bca0d3d923e9d4e05ef5514

tests/phpunit/structure/ApiDocumentationTest.php

index d2f96dc..5cf75bd 100644 (file)
@@ -33,6 +33,9 @@ class ApiDocumentationTest extends MediaWikiTestCase {
                if ( !self::$main ) {
                        self::$main = new ApiMain( RequestContext::getMain() );
                        self::$main->getContext()->setLanguage( 'en' );
+                       self::$main->getContext()->setTitle(
+                               Title::makeTitle( NS_SPECIAL, 'Badtitle/dummy title for ApiDocumentationTest' )
+                       );
                }
                return self::$main;
        }