Add test for IRC line for legacy type block/block
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 9 Apr 2015 09:32:56 +0000 (11:32 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Fri, 1 May 2015 18:14:22 +0000 (18:14 +0000)
Follow-Up: I08aea8399ce766e98c1a76e237169f220c6cc751
Change-Id: I8626e8ce28104d20a6145d47e647ef0ad86b3523

tests/phpunit/includes/changes/RecentChangeTest.php

index 0dba183..e39c382 100644 (file)
@@ -76,6 +76,19 @@ class RecentChangeTest extends MediaWikiTestCase {
                        ),
                        $this->user_comment
                );
+               # block/block - legacy
+               $this->assertIRCComment(
+                       $this->context->msg( 'blocklogentry', 'SomeTitle', 'duration', '(flags)' )->plain()
+                               . $sep . $this->user_comment,
+                       'block', 'block',
+                       array(
+                               'duration',
+                               'flags',
+                       ),
+                       $this->user_comment,
+                       '',
+                       true
+               );
                # block/unblock
                $this->assertIRCComment(
                        $this->context->msg( 'unblocklogentry', 'SomeTitle' )->plain() . $sep . $this->user_comment,
@@ -332,7 +345,7 @@ class RecentChangeTest extends MediaWikiTestCase {
         * @param string $msg (optional) A message for PHPUnit :-)
         */
        protected function assertIRCComment( $expected, $type, $action, $params,
-               $comment = null, $msg = ''
+               $comment = null, $msg = '', $legacy = false
        ) {
                $logEntry = new ManualLogEntry( $type, $action );
                $logEntry->setPerformer( $this->user );
@@ -341,6 +354,7 @@ class RecentChangeTest extends MediaWikiTestCase {
                        $logEntry->setComment( $comment );
                }
                $logEntry->setParameters( $params );
+               $logEntry->setLegacy( $legacy );
 
                $formatter = LogFormatter::newFromEntry( $logEntry );
                $formatter->setContext( $this->context );