mediawiki-extensions-Discus.../tests/phpunit/MockCommentFormatter.php
Umherirrender 64bcb583e9 Use namespaced classes
Done automatically via script
Change to extension.json done manually

Change-Id: Ied7bbddd357290ac6be6bf480be0ee9116e77365
2023-12-11 16:38:02 +01:00

32 lines
740 B
PHP

<?php
namespace MediaWiki\Extension\DiscussionTools\Tests;
use Language;
use MediaWiki\Extension\DiscussionTools\CommentFormatter;
use MediaWiki\Extension\DiscussionTools\CommentParser;
use MediaWiki\User\UserIdentity;
use MediaWiki\Utils\MWTimestamp;
class MockCommentFormatter extends CommentFormatter {
public static CommentParser $parser;
/**
* @return CommentParser
*/
protected static function getParser(): CommentParser {
return static::$parser;
}
/**
* @inheritDoc
*/
public static function getSignatureRelativeTime(
MWTimestamp $timestamp, Language $lang, UserIdentity $user
): string {
// Relative times can't be used in tests, so just return a plain timestamp
return $timestamp->getTimestamp();
}
}