/**
* Steal a callback function from the primary parser, save it for
* application to our scary parser. If the hook is not installed,
- * die a painful dead to warn the others.
+ * abort processing of this file.
*
* @param $name String
+ * @return Bool true if tag hook is present
*/
public function requireHook( $name ) {
global $wgParser;
if ( isset( $wgParser->mTagHooks[$name] ) ) {
$this->hooks[$name] = $wgParser->mTagHooks[$name];
} else {
- wfDie( "This test suite requires the '$name' hook extension.\n" );
+ echo " This test suite requires the '$name' hook extension, skipping.\n";
+ return false;
}
+ return true;
}
/**
* Steal a callback function from the primary parser, save it for
* application to our scary parser. If the hook is not installed,
- * die a painful dead to warn the others.
+ * abort processing of this file.
*
* @param $name String
+ * @return Bool true if function hook is present
*/
public function requireFunctionHook( $name ) {
global $wgParser;
if ( isset( $wgParser->mFunctionHooks[$name] ) ) {
$this->functionHooks[$name] = $wgParser->mFunctionHooks[$name];
} else {
- wfDie( "This test suite requires the '$name' function hook extension.\n" );
+ echo " This test suite requires the '$name' function hook extension, skipping.\n";
+ return false;
}
+ return true;
}
/*
foreach ( explode( "\n", $data['hooks'] ) as $line ) {
$line = trim( $line );
if ( $line ) {
- if ( $this->parser ) $this->parser->requireHook( $line );
+ if ( $this->parser && !$this->parser->requireHook( $line ) ) {
+ return false;
+ }
}
}
$data = array();
foreach ( explode( "\n", $data['functionhooks'] ) as $line ) {
$line = trim( $line );
if ( $line ) {
- if ( $this->parser ) $this->parser->requireFunctionHook( $line );
+ if ( $this->parser && !$this->parser->requireFunctionHook( $line ) ) {
+ return false;
+ }
}
}
$data = array();