I'm trying to test a parser tag extension with phpunit and have run into a
strange problem. Whenever my extension calls $parser->recursiveTagParse(), the 
unit
test blows up in Parser.php, complaining that $parser->mOptions is a non-object.

The tag callback looks pretty normal:

static function render($input, $argv, $parser, $frame) {
  // ...
  $parser->recursiveTagParse("something");
  // ...
}

and I have unit tests that call render()directly:

public function testMyTag() {
  global $wgParser;
  $this->assertEqual(MyTag::render("some text", array(), $wgParser, false));
}

(I don't like using $wgParser here, and maybe that's the root of my problems?)
The tag works perfectly in the browser. Just not when unit-testing on the 
command
line.

The blowup occurs in Parser.php::replaceVariables, when it calls
$this->mOptions->getMaxIncludeSize().

Any advice appreciated!!
Thanks,
DanB



_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to