From af1dfeead5406acc3fcdf8d13eb0997b343cb898 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 8 Nov 2016 16:29:04 -0500 Subject: [PATCH] Validate getExamplesMessages() query strings Assert that they don't begin with 'api.php?'. Change-Id: Idf5e8e08863a379a37a427a11936e5f9ce567396 Depends-On: I8a82eecefbb0ba327d8e8bc24ec535bcf40e6429 Depends-On: I476aad09655a2822381a2c61690b4b0ad423151e --- tests/phpunit/structure/ApiDocumentationTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/phpunit/structure/ApiDocumentationTest.php b/tests/phpunit/structure/ApiDocumentationTest.php index 2049e38ba0..bc5a6bd6c7 100644 --- a/tests/phpunit/structure/ApiDocumentationTest.php +++ b/tests/phpunit/structure/ApiDocumentationTest.php @@ -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" ); } } -- 2.20.1