protected $target;
protected $user;
protected $user_comment;
+ protected $context;
function __construct() {
parent::__construct();
$this->user = User::newFromName( 'UserName' );
$this->user_comment = '<User comment about action>';
+ $this->context = RequestContext::newExtraneousContext( $this->title );
}
/**
function testIrcMsgForLogTypeBlock() {
# block/block
$this->assertIRCComment(
- wfMessage( 'blocklogentry', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( 'blocklogentry', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
'block', 'block',
array(),
$this->user_comment
);
# block/unblock
$this->assertIRCComment(
- wfMessage( 'unblocklogentry', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( 'unblocklogentry', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
'block', 'unblock',
array(),
$this->user_comment
function testIrcMsgForLogTypeDelete() {
# delete/delete
$this->assertIRCComment(
- wfMessage( 'deletedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( 'deletedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
'delete', 'delete',
array(),
$this->user_comment
# delete/restore
$this->assertIRCComment(
- wfMessage( 'undeletedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( 'undeletedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
'delete', 'restore',
array(),
$this->user_comment
# move/move
$this->assertIRCComment(
- wfMessage( '1movedto2', 'SomeTitle', 'TestTarget' )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( '1movedto2', 'SomeTitle', 'TestTarget' )->plain() . ': ' . $this->user_comment,
'move', 'move',
$move_params,
$this->user_comment
# move/move_redir
$this->assertIRCComment(
- wfMessage( '1movedto2_redir', 'SomeTitle', 'TestTarget' )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( '1movedto2_redir', 'SomeTitle', 'TestTarget' )->plain() . ': ' . $this->user_comment,
'move', 'move_redir',
$move_params,
$this->user_comment
function testIrcMsgForLogTypePatrol() {
# patrol/patrol
$this->assertIRCComment(
- wfMessage( 'patrol-log-line', 'revision 777', '[[SomeTitle]]', '' )->plain(),
+ $this->context->msg( 'patrol-log-line', 'revision 777', '[[SomeTitle]]', '' )->plain(),
'patrol', 'patrol',
array(
'4::curid' => '777',
# protect/protect
$this->assertIRCComment(
- wfMessage( 'protectedarticle', 'SomeTitle ' . $protectParams[0] )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( 'protectedarticle', 'SomeTitle ' . $protectParams[0] )->plain() . ': ' . $this->user_comment,
'protect', 'protect',
$protectParams,
$this->user_comment
# protect/unprotect
$this->assertIRCComment(
- wfMessage( 'unprotectedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( 'unprotectedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
'protect', 'unprotect',
array(),
$this->user_comment
# protect/modify
$this->assertIRCComment(
- wfMessage( 'modifiedarticleprotection', 'SomeTitle ' . $protectParams[0] )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( 'modifiedarticleprotection', 'SomeTitle ' . $protectParams[0] )->plain() . ': ' . $this->user_comment,
'protect', 'modify',
$protectParams,
$this->user_comment
function testIrcMsgForLogTypeUpload() {
# upload/upload
$this->assertIRCComment(
- wfMessage( 'uploadedimage', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( 'uploadedimage', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
'upload', 'upload',
array(),
$this->user_comment
# upload/overwrite
$this->assertIRCComment(
- wfMessage( 'overwroteimage', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
+ $this->context->msg( 'overwroteimage', 'SomeTitle' )->plain() . ': ' . $this->user_comment,
'upload', 'overwrite',
array(),
$this->user_comment
* --
function testIrcMsgForBlankingAES() {
- // wfMessage( 'autosumm-blank', .. );
+ // $this->context->msg( 'autosumm-blank', .. );
}
function testIrcMsgForReplaceAES() {
- // wfMessage( 'autosumm-replace', .. );
+ // $this->context->msg( 'autosumm-replace', .. );
}
function testIrcMsgForRollbackAES() {
- // wfMessage( 'revertpage', .. );
+ // $this->context->msg( 'revertpage', .. );
}
function testIrcMsgForUndoAES() {
- // wfMessage( 'undo-summary', .. );
+ // $this->context->msg( 'undo-summary', .. );
}
* --
$logEntry->setParameters( $params );
$formatter = LogFormatter::newFromEntry( $logEntry );
- $formatter->setContext( RequestContext::newExtraneousContext( $this->title ) );
+ $formatter->setContext( $this->context );
// Apply the same transformation as done in RecentChange::getIRCLine for rc_comment
$ircRcComment = RecentChange::cleanupForIRC( $formatter->getIRCActionComment() );