jenkins-bot has submitted this change and it was merged.
Change subject: Minor tweaks to resource module definitions and test
......................................................................
Minor tweaks to resource module definitions and test
Change-Id: I362bd1534cf678d7ee8fbb4d5693887d3f2c345f
---
M resources/Resources.php
M tests/phpunit/includes/resources/ResourcesTest.php
2 files changed, 9 insertions(+), 6 deletions(-)
Approvals:
Mwjames: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/resources/Resources.php b/resources/Resources.php
index 97ed790..4507b60 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -29,6 +29,8 @@
* @author mwjames
*/
+global $smwgIP, $smwgScriptPath;
+
$moduleTemplate = array(
'localBasePath' => $smwgIP ,
'remoteBasePath' => $smwgScriptPath,
diff --git a/tests/phpunit/includes/resources/ResourcesTest.php
b/tests/phpunit/includes/resources/ResourcesTest.php
index e9a515c..087d43c 100644
--- a/tests/phpunit/includes/resources/ResourcesTest.php
+++ b/tests/phpunit/includes/resources/ResourcesTest.php
@@ -40,10 +40,12 @@
/**
* Helper method to load resources only valid for this extension
+ *
+ * @return array
*/
- private function load(){
- global $smwgIP, $smwgScriptPath;
- return include($smwgIP . "/resources/Resources.php");
+ private function getSMWResourceModules(){
+ global $smwgIP;
+ return include $smwgIP . '/resources/Resources.php';
}
/**
@@ -53,7 +55,7 @@
public function moduleDataProvider() {
$resourceLoader = new ResourceLoader();
$context = ResourceLoaderContext::newDummyContext();
- $modules = $this->load();
+ $modules = $this->getSMWResourceModules();
return array( array( $modules, $resourceLoader, $context ) );
}
@@ -64,7 +66,6 @@
* @dataProvider moduleDataProvider
*/
public function testModulesScriptsFilesAreAccessible( $modules,
ResourceLoader $resourceLoader, $context ){
-
foreach ( $modules as $name => $values ){
// Get module details
@@ -81,7 +82,6 @@
*
* @dataProvider moduleDataProvider
*/
-
public function testModulesStylesFilesAreAccessible( $modules,
ResourceLoader $resourceLoader, $context ){
foreach ( $modules as $name => $values ){
@@ -97,4 +97,5 @@
}
}
}
+
}
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/51667
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I362bd1534cf678d7ee8fbb4d5693887d3f2c345f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Mwjames <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits