registration: Only allow one extension to set a specific config setting
[lhc/web/wiklou.git] / tests / phpunit / structure / ApiDocumentationTest.php
index 542420a..83585af 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use Wikimedia\TestingAccessWrapper;
+
 /**
  * Checks that all API modules, core and extensions, have documentation i18n messages
  *
@@ -65,7 +67,7 @@ class ApiDocumentationTest extends MediaWikiTestCase {
                        RequestContext::getMain()->getConfig(),
                ] ) );
                foreach ( $globals as $k => $v ) {
-                       $this->setMWGlobals( "wg$k", $v );
+                       $this->setMwGlobals( "wg$k", $v );
                }
 
                // Fetch module.
@@ -77,7 +79,8 @@ class ApiDocumentationTest extends MediaWikiTestCase {
                }
 
                // Module description messages.
-               $this->checkMessage( $module->getDescriptionMessage(), 'Module description' );
+               $this->checkMessage( $module->getSummaryMessage(), 'Module summary' );
+               $this->checkMessage( $module->getExtendedDescription(), 'Module help top text' );
 
                // Parameters. Lots of messages in here.
                $params = $module->getFinalParams( ApiBase::GET_VALUES_FOR_HELP );
@@ -137,6 +140,8 @@ class ApiDocumentationTest extends MediaWikiTestCase {
 
                // Messages for examples.
                foreach ( $module->getExamplesMessages() as $qs => $msg ) {
+                       $this->assertStringStartsNotWith( 'api.php?', $qs,
+                               "Query string must not begin with 'api.php?'" );
                        $this->checkMessage( $msg, "Example $qs" );
                }
        }