MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374666 )

Change subject: Code sniffer fixes
......................................................................

Code sniffer fixes

* File name to match the class name
* No more two classes per file

Change-Id: I588bd552529cbc2b98ce71e4201abfd7baf25dd5
---
M extension.json
R includes/GeoData.php
M includes/api/ApiQueryGeoSearch.php
M tests/phpunit/GeoSearchTest.php
4 files changed, 9 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData 
refs/changes/66/374666/1

diff --git a/extension.json b/extension.json
index b3c4040..e3dd84a 100644
--- a/extension.json
+++ b/extension.json
@@ -29,7 +29,7 @@
                "GeoData\\CoordinatesIndexField" : 
"includes/Search/CoordinatesIndexField.php",
                "GeoData\\CoordinatesOutput": "includes/CoordinatesOutput.php",
                "GeoData\\CoordinatesParserFunction": 
"includes/CoordinatesParserFunction.php",
-               "GeoData\\GeoData": "includes/GeoData.body.php",
+               "GeoData\\GeoData": "includes/GeoData.php",
                "GeoData\\GeoPointIndexField" : 
"includes/Search/GeoPointIndexField.php",
                "GeoData\\GeoRadiusFunctionScoreBuilder": 
"includes/Search/GeoRadiusFunctionScoreBuilder.php",
                "GeoData\\Globe": "includes/Globe.php",
diff --git a/includes/GeoData.body.php b/includes/GeoData.php
similarity index 100%
rename from includes/GeoData.body.php
rename to includes/GeoData.php
diff --git a/includes/api/ApiQueryGeoSearch.php 
b/includes/api/ApiQueryGeoSearch.php
index 196c764..227c6b3 100644
--- a/includes/api/ApiQueryGeoSearch.php
+++ b/includes/api/ApiQueryGeoSearch.php
@@ -8,7 +8,7 @@
 use Title;
 use WikiPage;
 
-abstract class ApiQueryGeoSearch extends ApiQueryGeneratorBase {
+class ApiQueryGeoSearch extends ApiQueryGeneratorBase {
        const MIN_RADIUS = 10;
        const DEFAULT_RADIUS = 500;
 
diff --git a/tests/phpunit/GeoSearchTest.php b/tests/phpunit/GeoSearchTest.php
index 064d752..1966ec8 100644
--- a/tests/phpunit/GeoSearchTest.php
+++ b/tests/phpunit/GeoSearchTest.php
@@ -7,7 +7,6 @@
 use GeoData\ApiQueryGeoSearch;
 use MediaWikiTestCase;
 use ApiUsageException;
-use UsageException;
 
 /**
  * @group GeoData
@@ -15,7 +14,12 @@
 class GeoSearchTest extends MediaWikiTestCase {
        public function setUp() {
                $this->setMwGlobals( 'wgAPIListModules',
-                       [ 'geosearch' => 'GeoData\Test\MockApiQueryGeoSearch' ] 
);
+                       [
+                               'geosearch' => [
+                                       'class' => ApiQueryGeoSearch::class
+                               ]
+                       ]
+               );
                parent::setUp();
        }
 
@@ -31,10 +35,7 @@
         * @dataProvider provideRequiredParams
         */
        public function testRequiredParams( array $params ) {
-               $this->setExpectedException(
-                       class_exists( ApiUsageException::class )
-                               ? ApiUsageException::class : 
UsageException::class
-               );
+               $this->setExpectedException( ApiUsageException::class );
                $this->request( $params );
        }
 
@@ -58,7 +59,4 @@
                        ],
                ];
        }
-}
-
-class MockApiQueryGeoSearch extends ApiQueryGeoSearch {
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/374666
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I588bd552529cbc2b98ce71e4201abfd7baf25dd5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to