private $eof;
function __construct( $file, $parserTest ) {
- global $IP;
-
$this->file = $file;
$this->fh = fopen( $this->file, "rt" );
}
$this->parserTest = $parserTest;
- $this->parserTest->showRunFile( wfRelativePath( $this->file, $IP ) );
$this->lineNum = $this->index = 0;
}
}
}
-
/**
* A class to delay execution of a parser test hooks.
- *
*/
class DelayedParserTest {
* Called whenever we actually want to run the hook.
* Should be the case if we found the parserTest is not disabled
*/
- public function unleash( ParserTest &$parserTest ) {
+ public function unleash( &$parserTest ) {
+ if( !($parserTest instanceof ParserTest || $parserTest instanceof NewParserTest
+ ) ) {
+ throw new MWException( __METHOD__ . " must be passed an instance of ParserTest or NewParserTest classes\n" );
+ }
+
# Trigger delayed hooks. Any failure will make us abort
foreach( $this->hooks as $hook ) {
$ret = $parserTest->requireHook( $hook );
$this->fnHooks[] = $fnHook;
}
-}
+}
\ No newline at end of file