2016-10-06 05:41:15 +00:00
|
|
|
<?php
|
|
|
|
|
|
2019-12-30 06:58:16 +00:00
|
|
|
use MediaWiki\Page\PageReference;
|
2023-12-13 22:50:44 +00:00
|
|
|
use MediaWiki\Parser\Parser;
|
2024-10-16 00:35:06 +00:00
|
|
|
use MediaWiki\Parser\ParserOptions;
|
2023-12-14 19:20:33 +00:00
|
|
|
use MediaWiki\Parser\ParserOutput;
|
2019-12-30 06:58:16 +00:00
|
|
|
use MediaWiki\User\UserIdentity;
|
|
|
|
|
|
2016-10-06 05:41:15 +00:00
|
|
|
/**
|
|
|
|
|
* A parser used during article insertion which does nothing, to avoid
|
|
|
|
|
* unnecessary log noise and other interference with debugging.
|
|
|
|
|
*/
|
2019-12-30 06:58:16 +00:00
|
|
|
class ParserTestMockParser extends Parser {
|
|
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function preSaveTransform( $text, PageReference $page, UserIdentity $user,
|
2016-10-06 05:41:15 +00:00
|
|
|
ParserOptions $options, $clearState = true
|
|
|
|
|
) {
|
|
|
|
|
return $text;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function parse(
|
2019-12-30 06:58:16 +00:00
|
|
|
$text, PageReference $page, ParserOptions $options,
|
2016-10-06 05:41:15 +00:00
|
|
|
$linestart = true, $clearState = true, $revid = null
|
|
|
|
|
) {
|
|
|
|
|
return new ParserOutput;
|
|
|
|
|
}
|
2018-04-10 13:45:53 +00:00
|
|
|
|
|
|
|
|
public function getOutput() {
|
|
|
|
|
return new ParserOutput;
|
|
|
|
|
}
|
2016-10-06 05:41:15 +00:00
|
|
|
}
|