<?php
-if (!defined('MEDIAWIKI')) die();
+if ( ! defined( 'MEDIAWIKI' ) )
+ die( -1 );
/**
* A basic extension that's used by the parser tests to test whether input and
* arguments are passed to extensions properly.
*
- * @package MediaWiki
- * @subpackage Maintenance
+ * @file
+ * @ingroup Maintenance
*
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
+ * @copyright Copyright © 2005, 2006 Ævar Arnfjörð Bjarmason
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*/
-$wgHooks['ParserTestParser'][] = 'wfParserSetup';
+$wgHooks['ParserTestParser'][] = 'wfParserTestParserHookSetup';
-function wfParserSetup( &$parser ) {
- $parser->setHook( 'tag', 'wfParserHook' );
+function wfParserTestParserHookSetup( &$parser ) {
+ $parser->setHook( 'tag', 'wfParserTestParserHookHook' );
+
+ return true;
}
-
-function wfParserHook( $in, $argv ) {
- if ( count( $argv ) )
- return "<pre>\n" . print_r( $argv, true ) . '</pre>';
- else
- return $in;
+
+function wfParserTestParserHookHook( $in, $argv ) {
+ ob_start();
+ var_dump(
+ $in,
+ $argv
+ );
+ $ret = ob_get_clean();
+
+ return "<pre>\n$ret</pre>";
}
+