Index: trunk/extensions/Math/Math.php |
— | — | @@ -89,6 +89,7 @@ |
90 | 90 | $wgHooks['GetPreferences'][] = 'MathHooks::onGetPreferences'; |
91 | 91 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'MathHooks::onLoadExtensionSchemaUpdates'; |
92 | 92 | $wgHooks['ParserTestTables'][] = 'MathHooks::onParserTestTables'; |
| 93 | +$wgHooks['ParserTestParser'][] = 'MathHooks::onParserTestParser'; |
93 | 94 | |
94 | 95 | $dir = dirname( __FILE__ ) . '/'; |
95 | 96 | $wgAutoloadClasses['MathHooks'] = $dir . 'Math.hooks.php'; |
Index: trunk/extensions/Math/Math.hooks.php |
— | — | @@ -136,4 +136,18 @@ |
137 | 137 | $tables[] = 'math'; |
138 | 138 | return true; |
139 | 139 | } |
| 140 | + |
| 141 | + /** |
| 142 | + * Hack to fake a default $wgMathPath value so parser test output |
| 143 | + * that renders to images doesn't vary by who runs it. |
| 144 | + * |
| 145 | + * @global string $wgMathPath |
| 146 | + * @param Parser $parser |
| 147 | + * @return bool |
| 148 | + */ |
| 149 | + static function onParserTestParser( &$parser ) { |
| 150 | + global $wgMathPath; |
| 151 | + $wgMathPath = '/images/math'; |
| 152 | + return true; |
| 153 | + } |
140 | 154 | } |