wiki.techinc.nl/tests/parser/ParserTestMockParser.php
Tim Starling 65b732f295 parserTests: Use a mock parser during article insertion
This makes debugging simpler by avoiding log noise, hitting breakpoints
unexpectedly, etc. This means that {{subst:}} is no longer supported in
!!article sections, but I could only find one test which relied on that.

Change-Id: I6400defa389389e5d9632fb01d4a534c0d88d442
2016-10-06 17:08:27 +11:00

20 lines
480 B
PHP

<?php
/**
* A parser used during article insertion which does nothing, to avoid
* unnecessary log noise and other interference with debugging.
*/
class ParserTestMockParser {
public function preSaveTransform( $text, Title $title, User $user,
ParserOptions $options, $clearState = true
) {
return $text;
}
public function parse(
$text, Title $title, ParserOptions $options,
$linestart = true, $clearState = true, $revid = null
) {
return new ParserOutput;
}
}