The delayed parser test feature was expecting a ParserTest object which is
almost never the case when using the NewParserTest for PHPUnit. The class
name is forged after the file name! They at least all extends NewParserTest
no polymorphism? no multiple hinting. Be creative the PHP way by writing
your own code :-(
* 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 );