Index: trunk/phase3/tests/phpunit/includes/RecentChangeTest.php |
— | — | @@ -4,6 +4,7 @@ |
5 | 5 | protected $target; |
6 | 6 | protected $user; |
7 | 7 | protected $user_comment; |
| 8 | + protected $context; |
8 | 9 | |
9 | 10 | function __construct() { |
10 | 11 | parent::__construct(); |
— | — | @@ -13,6 +14,7 @@ |
14 | 15 | $this->user = User::newFromName( 'UserName' ); |
15 | 16 | |
16 | 17 | $this->user_comment = '<User comment about action>'; |
| 18 | + $this->context = RequestContext::newExtraneousContext( $this->title ); |
17 | 19 | } |
18 | 20 | |
19 | 21 | /** |
— | — | @@ -54,14 +56,14 @@ |
55 | 57 | function testIrcMsgForLogTypeBlock() { |
56 | 58 | # block/block |
57 | 59 | $this->assertIRCComment( |
58 | | - wfMessage( 'blocklogentry', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
| 60 | + $this->context->msg( 'blocklogentry', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
59 | 61 | 'block', 'block', |
60 | 62 | array(), |
61 | 63 | $this->user_comment |
62 | 64 | ); |
63 | 65 | # block/unblock |
64 | 66 | $this->assertIRCComment( |
65 | | - wfMessage( 'unblocklogentry', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
| 67 | + $this->context->msg( 'unblocklogentry', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
66 | 68 | 'block', 'unblock', |
67 | 69 | array(), |
68 | 70 | $this->user_comment |
— | — | @@ -74,7 +76,7 @@ |
75 | 77 | function testIrcMsgForLogTypeDelete() { |
76 | 78 | # delete/delete |
77 | 79 | $this->assertIRCComment( |
78 | | - wfMessage( 'deletedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
| 80 | + $this->context->msg( 'deletedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
79 | 81 | 'delete', 'delete', |
80 | 82 | array(), |
81 | 83 | $this->user_comment |
— | — | @@ -82,7 +84,7 @@ |
83 | 85 | |
84 | 86 | # delete/restore |
85 | 87 | $this->assertIRCComment( |
86 | | - wfMessage( 'undeletedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
| 88 | + $this->context->msg( 'undeletedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
87 | 89 | 'delete', 'restore', |
88 | 90 | array(), |
89 | 91 | $this->user_comment |
— | — | @@ -126,7 +128,7 @@ |
127 | 129 | |
128 | 130 | # move/move |
129 | 131 | $this->assertIRCComment( |
130 | | - wfMessage( '1movedto2', 'SomeTitle', 'TestTarget' )->plain() . ': ' . $this->user_comment, |
| 132 | + $this->context->msg( '1movedto2', 'SomeTitle', 'TestTarget' )->plain() . ': ' . $this->user_comment, |
131 | 133 | 'move', 'move', |
132 | 134 | $move_params, |
133 | 135 | $this->user_comment |
— | — | @@ -134,7 +136,7 @@ |
135 | 137 | |
136 | 138 | # move/move_redir |
137 | 139 | $this->assertIRCComment( |
138 | | - wfMessage( '1movedto2_redir', 'SomeTitle', 'TestTarget' )->plain() . ': ' . $this->user_comment, |
| 140 | + $this->context->msg( '1movedto2_redir', 'SomeTitle', 'TestTarget' )->plain() . ': ' . $this->user_comment, |
139 | 141 | 'move', 'move_redir', |
140 | 142 | $move_params, |
141 | 143 | $this->user_comment |
— | — | @@ -147,7 +149,7 @@ |
148 | 150 | function testIrcMsgForLogTypePatrol() { |
149 | 151 | # patrol/patrol |
150 | 152 | $this->assertIRCComment( |
151 | | - wfMessage( 'patrol-log-line', 'revision 777', '[[SomeTitle]]', '' )->plain(), |
| 153 | + $this->context->msg( 'patrol-log-line', 'revision 777', '[[SomeTitle]]', '' )->plain(), |
152 | 154 | 'patrol', 'patrol', |
153 | 155 | array( |
154 | 156 | '4::curid' => '777', |
— | — | @@ -167,7 +169,7 @@ |
168 | 170 | |
169 | 171 | # protect/protect |
170 | 172 | $this->assertIRCComment( |
171 | | - wfMessage( 'protectedarticle', 'SomeTitle ' . $protectParams[0] )->plain() . ': ' . $this->user_comment, |
| 173 | + $this->context->msg( 'protectedarticle', 'SomeTitle ' . $protectParams[0] )->plain() . ': ' . $this->user_comment, |
172 | 174 | 'protect', 'protect', |
173 | 175 | $protectParams, |
174 | 176 | $this->user_comment |
— | — | @@ -175,7 +177,7 @@ |
176 | 178 | |
177 | 179 | # protect/unprotect |
178 | 180 | $this->assertIRCComment( |
179 | | - wfMessage( 'unprotectedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
| 181 | + $this->context->msg( 'unprotectedarticle', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
180 | 182 | 'protect', 'unprotect', |
181 | 183 | array(), |
182 | 184 | $this->user_comment |
— | — | @@ -183,7 +185,7 @@ |
184 | 186 | |
185 | 187 | # protect/modify |
186 | 188 | $this->assertIRCComment( |
187 | | - wfMessage( 'modifiedarticleprotection', 'SomeTitle ' . $protectParams[0] )->plain() . ': ' . $this->user_comment, |
| 189 | + $this->context->msg( 'modifiedarticleprotection', 'SomeTitle ' . $protectParams[0] )->plain() . ': ' . $this->user_comment, |
188 | 190 | 'protect', 'modify', |
189 | 191 | $protectParams, |
190 | 192 | $this->user_comment |
— | — | @@ -196,7 +198,7 @@ |
197 | 199 | function testIrcMsgForLogTypeUpload() { |
198 | 200 | # upload/upload |
199 | 201 | $this->assertIRCComment( |
200 | | - wfMessage( 'uploadedimage', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
| 202 | + $this->context->msg( 'uploadedimage', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
201 | 203 | 'upload', 'upload', |
202 | 204 | array(), |
203 | 205 | $this->user_comment |
— | — | @@ -204,7 +206,7 @@ |
205 | 207 | |
206 | 208 | # upload/overwrite |
207 | 209 | $this->assertIRCComment( |
208 | | - wfMessage( 'overwroteimage', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
| 210 | + $this->context->msg( 'overwroteimage', 'SomeTitle' )->plain() . ': ' . $this->user_comment, |
209 | 211 | 'upload', 'overwrite', |
210 | 212 | array(), |
211 | 213 | $this->user_comment |
— | — | @@ -217,19 +219,19 @@ |
218 | 220 | * -- |
219 | 221 | |
220 | 222 | function testIrcMsgForBlankingAES() { |
221 | | - // wfMessage( 'autosumm-blank', .. ); |
| 223 | + // $this->context->msg( 'autosumm-blank', .. ); |
222 | 224 | } |
223 | 225 | |
224 | 226 | function testIrcMsgForReplaceAES() { |
225 | | - // wfMessage( 'autosumm-replace', .. ); |
| 227 | + // $this->context->msg( 'autosumm-replace', .. ); |
226 | 228 | } |
227 | 229 | |
228 | 230 | function testIrcMsgForRollbackAES() { |
229 | | - // wfMessage( 'revertpage', .. ); |
| 231 | + // $this->context->msg( 'revertpage', .. ); |
230 | 232 | } |
231 | 233 | |
232 | 234 | function testIrcMsgForUndoAES() { |
233 | | - // wfMessage( 'undo-summary', .. ); |
| 235 | + // $this->context->msg( 'undo-summary', .. ); |
234 | 236 | } |
235 | 237 | |
236 | 238 | * -- |
— | — | @@ -253,7 +255,7 @@ |
254 | 256 | $logEntry->setParameters( $params ); |
255 | 257 | |
256 | 258 | $formatter = LogFormatter::newFromEntry( $logEntry ); |
257 | | - $formatter->setContext( RequestContext::newExtraneousContext( $this->title ) ); |
| 259 | + $formatter->setContext( $this->context ); |
258 | 260 | |
259 | 261 | // Apply the same transformation as done in RecentChange::getIRCLine for rc_comment |
260 | 262 | $ircRcComment = RecentChange::cleanupForIRC( $formatter->getIRCActionComment() ); |