Validate getExamplesMessages() query strings
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 8 Nov 2016 21:29:04 +0000 (16:29 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Thu, 10 Nov 2016 15:17:04 +0000 (10:17 -0500)
Assert that they don't begin with 'api.php?'.

Change-Id: Idf5e8e08863a379a37a427a11936e5f9ce567396
Depends-On: I8a82eecefbb0ba327d8e8bc24ec535bcf40e6429
Depends-On: I476aad09655a2822381a2c61690b4b0ad423151e

tests/phpunit/structure/ApiDocumentationTest.php

index 2049e38..bc5a6bd 100644 (file)
@@ -137,6 +137,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" );
                }
        }