MaxSem has uploaded a new change for review.
https://gerrit.wikimedia.org/r/67353
Change subject: Move UnitTestsList handler to MobileFrontendHooks
......................................................................
Move UnitTestsList handler to MobileFrontendHooks
Change-Id: Ia92e443894aa81e4e2c0d155d7f687feacda9642
---
M MobileFrontend.php
M includes/MobileFrontend.hooks.php
2 files changed, 24 insertions(+), 23 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/53/67353/1
diff --git a/MobileFrontend.php b/MobileFrontend.php
index dc80df1..18db9c4 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -110,6 +110,7 @@
$wgHooks['CustomEditor'][] = 'MobileFrontendHooks::onCustomEditor';
$wgHooks['GetPreferences'][] = 'MobileFrontendHooks::onGetPreferences';
$wgHooks['Gadgets::allowLegacy'][] =
'MobileFrontendHooks::onAllowLegacyGadgets';
+$wgHooks['UnitTestsList'][] = 'MobileFrontendHooks::onUnitTestsList';
$wgSpecialPages['Uploads'] = 'SpecialUploads';
$wgSpecialPages['MobileDiff'] = 'SpecialMobileDiff';
@@ -128,29 +129,6 @@
if ( $wgMFLoginHandshakeUrl ) {
$wgSpecialPages['LoginHandshake'] = 'SpecialLoginHandshake';
}
-}
-
-// Unit tests
-$wgHooks['UnitTestsList'][] = 'efExtMobileFrontendUnitTests';
-
-/**
- * @param $files array
- * @return bool
- */
-function efExtMobileFrontendUnitTests( &$files ) {
- $dir = dirname( __FILE__ ) . '/tests';
-
- $files[] = "$dir/ApiParseExtenderTest.php";
- $files[] = "$dir/MobileContextTest.php";
- $files[] = "$dir/MobileFrontendTest.php";
- $files[] = "$dir/DeviceDetectionTest.php";
- $files[] = "$dir/HtmlFormatterTest.php";
- $files[] = "$dir/MobileFormatterTest.php";
- $files[] = "$dir/modules/MFResourceLoaderModuleTest.php";
-
- // special page tests
- $files[] = "$dir/specials/SpecialMobileDiffTest.php";
- return true;
}
// ResourceLoader modules
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index c2c288f..2768f79 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -528,4 +528,27 @@
public static function onAllowLegacyGadgets() {
return !MobileContext::singleton()->shouldDisplayMobileView();
}
+
+ /**
+ * UnitTestsList hook handler
+ * @see https://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList
+ *
+ * @param $files array
+ * @return bool
+ */
+ public static function onUnitTestsList( &$files ) {
+ $dir = dirname( dirname( __FILE__ ) ) . '/tests';
+
+ $files[] = "$dir/ApiParseExtenderTest.php";
+ $files[] = "$dir/MobileContextTest.php";
+ $files[] = "$dir/MobileFrontendTest.php";
+ $files[] = "$dir/DeviceDetectionTest.php";
+ $files[] = "$dir/HtmlFormatterTest.php";
+ $files[] = "$dir/MobileFormatterTest.php";
+ $files[] = "$dir/modules/MFResourceLoaderModuleTest.php";
+
+ // special page tests
+ $files[] = "$dir/specials/SpecialMobileDiffTest.php";
+ return true;
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/67353
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia92e443894aa81e4e2c0d155d7f687feacda9642
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits