mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-11 00:02:43 +00:00
433e57394c
Change-Id: I788db64f0c0c00894d77256b7f016d44eda4bbb1
32 lines
724 B
PHP
32 lines
724 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 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();
|
|
}
|
|
}
|