mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-28 02:00:57 +00:00
da64c43ccc
Bug: T269950 Change-Id: Ifa47ddcbccf288be0bbecd5961eab7c5122aab7b
33 lines
732 B
PHP
33 lines
732 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 {
|
|
|
|
/**
|
|
* @var CommentParser
|
|
*/
|
|
public static $parser;
|
|
|
|
/**
|
|
* @return CommentParser
|
|
*/
|
|
protected static function getParser(): CommentParser {
|
|
return static::$parser;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public static function getSignatureRelativeTime( MWTimestamp $timestamp, Language $lang, UserIdentity $user ) {
|
|
// Relative times can't be used in tests, so just return a plain timestamp
|
|
return $timestamp->getTimestamp();
|
|
}
|
|
}
|