wiki.techinc.nl/tests/parser/ParserTestMockParser.php
TheSandDoctor da38639658 Remove deprecated $wgParser
$wgParser, deprecated in 1.32, has been removed.

Bug: T160811
Change-Id: Iaf09d3e158e1fee8c0f541695b6d9b4233033c81
2022-08-03 14:40:16 +02:00

31 lines
685 B
PHP

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