wiki.techinc.nl/tests/parser/ParserTestMockParser.php
Subramanya Sastry e55cc517da Move Parser to Mediawiki\Parser namespace
Bug: T166010
Co-Authored-By: Daimona Eaytoy <daimona.wiki@gmail.com>
Co-Authored-By: James Forrester <jforrester@wikimedia.org>
Co-Authored-By: Subramanya Sastry <ssastry@wikimedia.org>
Change-Id: I79b4e732c45095eedbaa80afa5eb7479b387ed8a
2024-02-16 09:18:38 -05:00

33 lines
749 B
PHP

<?php
use MediaWiki\Page\PageReference;
use MediaWiki\Parser\Parser;
use MediaWiki\Parser\ParserOutput;
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;
}
}