Siebrand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/118300

Change subject: Fix CodeSniffer errors and warnings in changes tests
......................................................................

Fix CodeSniffer errors and warnings in changes tests

Follow-up to 1c6b7c74859e7.

Change-Id: Ib42621a03a43487d94ff1cb755544823a8adda9c
---
M tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
M tests/phpunit/includes/changes/RecentChangeTest.php
2 files changed, 30 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/118300/1

diff --git a/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php 
b/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
index dc47e35..49feec1 100644
--- a/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
+++ b/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @covers RCCacheEntryFactory
  *
@@ -8,7 +9,6 @@
  * @author Katie Filbert < aude.w...@gmail.com >
  */
 class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
-
        protected function setUp() {
                parent::setUp();
 
@@ -20,7 +20,9 @@
        /**
         * @dataProvider editChangeProvider
         */
-       public function testNewFromRecentChange( $expected, $context, 
$messages, $recentChange, $watched ) {
+       public function testNewFromRecentChange( $expected, $context, $messages,
+               $recentChange, $watched
+       ) {
                $cacheEntryFactory = new RCCacheEntryFactory( $context, 
$messages );
                $cacheEntry = $cacheEntryFactory->newFromRecentChange( 
$recentChange, $watched );
 
@@ -28,7 +30,10 @@
 
                $this->assertEquals( $watched, $cacheEntry->watched, 'watched' 
);
                $this->assertEquals( $expected['timestamp'], 
$cacheEntry->timestamp, 'timestamp' );
-               $this->assertEquals( $expected['numberofWatchingusers'], 
$cacheEntry->numberofWatchingusers, 'watching users' );
+               $this->assertEquals(
+                       $expected['numberofWatchingusers'], 
$cacheEntry->numberofWatchingusers,
+                       'watching users'
+               );
                $this->assertEquals( $expected['unpatrolled'], 
$cacheEntry->unpatrolled, 'unpatrolled' );
 
                $this->assertUserLinks( 'Mary', $cacheEntry );
@@ -98,7 +103,10 @@
 
                $this->assertEquals( $watched, $cacheEntry->watched, 'watched' 
);
                $this->assertEquals( $expected['timestamp'], 
$cacheEntry->timestamp, 'timestamp' );
-               $this->assertEquals( $expected['numberofWatchingusers'], 
$cacheEntry->numberofWatchingusers, 'watching users' );
+               $this->assertEquals(
+                       $expected['numberofWatchingusers'],
+                       $cacheEntry->numberofWatchingusers, 'watching users'
+               );
                $this->assertEquals( $expected['unpatrolled'], 
$cacheEntry->unpatrolled, 'unpatrolled' );
 
                $this->assertDeleteLogLink( $cacheEntry );
@@ -168,7 +176,10 @@
 
                $this->assertEquals( $watched, $cacheEntry->watched, 'watched' 
);
                $this->assertEquals( $expected['timestamp'], 
$cacheEntry->timestamp, 'timestamp' );
-               $this->assertEquals( $expected['numberofWatchingusers'], 
$cacheEntry->numberofWatchingusers, 'watching users' );
+               $this->assertEquals(
+                       $expected['numberofWatchingusers'],
+                       $cacheEntry->numberofWatchingusers, 'watching users'
+               );
                $this->assertEquals( $expected['unpatrolled'], 
$cacheEntry->unpatrolled, 'unpatrolled' );
 
                $this->assertRevDel( $cacheEntry );
@@ -325,7 +336,7 @@
                        'assert query link element'
                );
 
-               foreach( $params as $key => $value ) {
+               foreach ( $params as $key => $value ) {
                        $this->assertRegExp( '/' . $key . '=' . $value . '/', 
$link, "verify $key link params" );
                }
        }
@@ -368,7 +379,7 @@
        private function getTestUser() {
                $user = User::newFromName( 'Mary' );
 
-               if ( ! $user->getId() ) {
+               if ( !$user->getId() ) {
                        $user->addToDatabase();
                }
 
@@ -401,5 +412,4 @@
 
                return $context;
        }
-
 }
diff --git a/tests/phpunit/includes/changes/RecentChangeTest.php 
b/tests/phpunit/includes/changes/RecentChangeTest.php
index cfa3e77..c63675e 100644
--- a/tests/phpunit/includes/changes/RecentChangeTest.php
+++ b/tests/phpunit/includes/changes/RecentChangeTest.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @group Database
  */
@@ -136,7 +137,8 @@
 
                # move/move
                $this->assertIRCComment(
-                       $this->context->msg( '1movedto2', 'SomeTitle', 
'TestTarget' )->plain() . $sep . $this->user_comment,
+                       $this->context->msg( '1movedto2', 'SomeTitle', 
'TestTarget' )
+                               ->plain() . $sep . $this->user_comment,
                        'move', 'move',
                        $move_params,
                        $this->user_comment
@@ -144,7 +146,8 @@
 
                # move/move_redir
                $this->assertIRCComment(
-                       $this->context->msg( '1movedto2_redir', 'SomeTitle', 
'TestTarget' )->plain() . $sep . $this->user_comment,
+                       $this->context->msg( '1movedto2_redir', 'SomeTitle', 
'TestTarget' )
+                               ->plain() . $sep . $this->user_comment,
                        'move', 'move_redir',
                        $move_params,
                        $this->user_comment
@@ -178,7 +181,8 @@
 
                # protect/protect
                $this->assertIRCComment(
-                       $this->context->msg( 'protectedarticle', 'SomeTitle ' . 
$protectParams[0] )->plain() . $sep . $this->user_comment,
+                       $this->context->msg( 'protectedarticle', 'SomeTitle ' . 
$protectParams[0] )
+                               ->plain() . $sep . $this->user_comment,
                        'protect', 'protect',
                        $protectParams,
                        $this->user_comment
@@ -194,7 +198,8 @@
 
                # protect/modify
                $this->assertIRCComment(
-                       $this->context->msg( 'modifiedarticleprotection', 
'SomeTitle ' . $protectParams[0] )->plain() . $sep . $this->user_comment,
+                       $this->context->msg( 'modifiedarticleprotection', 
'SomeTitle ' . $protectParams[0] )
+                               ->plain() . $sep . $this->user_comment,
                        'protect', 'modify',
                        $protectParams,
                        $this->user_comment
@@ -255,8 +260,9 @@
         * @param $comment String (optional) A comment for the log action
         * @param $msg String (optional) A message for PHPUnit :-)
         */
-       protected function assertIRCComment( $expected, $type, $action, 
$params, $comment = null, $msg = '' ) {
-
+       protected function assertIRCComment( $expected, $type, $action, $params,
+               $comment = null, $msg = ''
+       ) {
                $logEntry = new ManualLogEntry( $type, $action );
                $logEntry->setPerformer( $this->user );
                $logEntry->setTarget( $this->title );

-- 
To view, visit https://gerrit.wikimedia.org/r/118300
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib42621a03a43487d94ff1cb755544823a8adda9c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <siebr...@kitano.nl>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to