r97002 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97001‎ | r97002 | r97003 >
Date:21:03, 13 September 2011
Author:brion
Status:ok
Tags:math 
Comment:
Followup r97001: fix for Math parser tests image URLs

Setting $wgMathPath to a fixed value during parser test runs so the values are predictable.
Modified paths:
  • /trunk/extensions/Math/Math.hooks.php (modified) (history)
  • /trunk/extensions/Math/Math.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Math/Math.php
@@ -89,6 +89,7 @@
9090 $wgHooks['GetPreferences'][] = 'MathHooks::onGetPreferences';
9191 $wgHooks['LoadExtensionSchemaUpdates'][] = 'MathHooks::onLoadExtensionSchemaUpdates';
9292 $wgHooks['ParserTestTables'][] = 'MathHooks::onParserTestTables';
 93+$wgHooks['ParserTestParser'][] = 'MathHooks::onParserTestParser';
9394
9495 $dir = dirname( __FILE__ ) . '/';
9596 $wgAutoloadClasses['MathHooks'] = $dir . 'Math.hooks.php';
Index: trunk/extensions/Math/Math.hooks.php
@@ -136,4 +136,18 @@
137137 $tables[] = 'math';
138138 return true;
139139 }
 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+ }
140154 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r97259REL1_18 MFT r97001, r97002, r97007, r97014, r97018, r97034reedy13:06, 16 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96990Revert changes to texvc that provide no test cases or examples of what they'r...brion19:00, 13 September 2011
r97001* (bug 26380) Add support for \widetilde to <math>...brion21:02, 13 September 2011

Status & tagging log