X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FparserTests.inc;h=06c3a4ad7a709317f2c74d7223f014e6db1738bd;hb=896d5762ba45ced07d774d0f71eb0db74331ae32;hp=3756de1ba4d58934aff86051ddc42c0a1ac72e4a;hpb=2566c36e367aefa3e0ef3dca2d085224d6f34f7f;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/parserTests.inc b/maintenance/parserTests.inc index 3756de1ba4..06c3a4ad7a 100644 --- a/maintenance/parserTests.inc +++ b/maintenance/parserTests.inc @@ -32,6 +32,8 @@ require_once( 'commandLine.inc' ); require_once( "$IP/includes/ObjectCache.php" ); require_once( "$IP/includes/BagOStuff.php" ); require_once( "$IP/languages/LanguageUtf8.php" ); +require_once( "$IP/includes/Hooks.php" ); +require_once( "$IP/maintenance/parserTestsParserHook.php" ); /** * @package MediaWiki @@ -236,6 +238,7 @@ class ParserTest { } $parser =& new Parser(); + wfRunHooks( 'ParserTestParser', array( &$parser ) ); $title =& Title::makeTitle( NS_MAIN, $titleText ); if (preg_match('/\\bpst\\b/i', $opts)) { @@ -303,6 +306,7 @@ class ParserTest { 'wgDefaultUserOptions' => array(), 'wgNoFollowLinks' => true, 'wgThumbnailScriptPath' => false, + 'wgUseTeX' => false, ); $this->savedGlobals = array(); foreach( $settings as $var => $val ) { @@ -658,10 +662,26 @@ class ParserTest { return $text; } + /** + * Hack up a private DOCTYPE with HTML's standard entity declarations. + * PHP 4 seemed to know these if you gave it an HTML doctype, but + * PHP 5.1 doesn't. + * @return string + * @access private + */ + function hackDocType() { + global $wgHtmlEntities; + $out = " $codepoint ) { + $out .= ""; + } + $out .= "]>\n"; + return $out; + } + function wellFormed( $text ) { $html = - '' . + $this->hackDocType() . '' . $text . '';