mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-23 23:25:02 +00:00
Followup r97001: fix for Math parser tests image URLs
Setting $wgMathPath to a fixed value during parser test runs so the values are predictable.
This commit is contained in:
parent
ae124a1e73
commit
6d5b5679fd
|
@ -136,4 +136,18 @@ class MathHooks {
|
|||
$tables[] = 'math';
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hack to fake a default $wgMathPath value so parser test output
|
||||
* that renders to images doesn't vary by who runs it.
|
||||
*
|
||||
* @global string $wgMathPath
|
||||
* @param Parser $parser
|
||||
* @return bool
|
||||
*/
|
||||
static function onParserTestParser( &$parser ) {
|
||||
global $wgMathPath;
|
||||
$wgMathPath = '/images/math';
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
1
Math.php
1
Math.php
|
@ -89,6 +89,7 @@ $wgHooks['ParserFirstCallInit'][] = 'MathHooks::onParserFirstCallInit';
|
|||
$wgHooks['GetPreferences'][] = 'MathHooks::onGetPreferences';
|
||||
$wgHooks['LoadExtensionSchemaUpdates'][] = 'MathHooks::onLoadExtensionSchemaUpdates';
|
||||
$wgHooks['ParserTestTables'][] = 'MathHooks::onParserTestTables';
|
||||
$wgHooks['ParserTestParser'][] = 'MathHooks::onParserTestParser';
|
||||
|
||||
$dir = dirname( __FILE__ ) . '/';
|
||||
$wgAutoloadClasses['MathHooks'] = $dir . 'Math.hooks.php';
|
||||
|
|
Loading…
Reference in a new issue