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
}
}
if( $total > 0 ) {
- $ratio = sprintf( "%.2f", 100 * $success / $total );
- print $this->termColor( 1 ) . "\nPassed $success of $total tests ($ratio%) ";
+ $ratio = wfPercent( 100 * $success / $total );
+ print $this->termColor( 1 ) . "\nPassed $success of $total tests ($ratio) ";
if( $success == $total ) {
print $this->termColor( 32 ) . "PASSED!";
} else {
$this->setupGlobals($opts);
$user =& new User();
- $options =& ParserOptions::newFromUser( $user );
+ $options = ParserOptions::newFromUser( $user );
if (preg_match('/\\bmath\\b/i', $opts)) {
# XXX this should probably be done by the ParserOptions
}
$parser =& new Parser();
+ wfRunHooks( 'ParserTestParser', array( &$parser ) );
$title =& Title::makeTitle( NS_MAIN, $titleText );
if (preg_match('/\\bpst\\b/i', $opts)) {
} elseif (preg_match('/\\bmsg\\b/i', $opts)) {
$out = $parser->transformMsg( $input, $options );
} else {
- $output =& $parser->parse( $input, $title, $options );
+ $output = $parser->parse( $input, $title, $options );
$out = $output->getText();
if (preg_match('/\\bill\\b/i', $opts)) {
'wgScript' => '/index.php',
'wgScriptPath' => '/',
'wgArticlePath' => '/wiki/$1',
- 'wgUploadPath' => '/images',
+ 'wgUploadPath' => 'http://example.com/images',
'wgUploadDirectory' => $this->uploadDir,
'wgStyleSheetPath' => '/skins',
'wgSitename' => 'MediaWiki',
'wgDefaultUserOptions' => array(),
'wgNoFollowLinks' => true,
'wgThumbnailScriptPath' => false,
+ 'wgUseTeX' => false,
);
$this->savedGlobals = array();
foreach( $settings as $var => $val ) {