Merge "Fix eslint warnings and switch to error code"
[lhc/web/wiklou.git] / tests / phpunit / includes / user / UserTest.php
index 294bd80..3b8e710 100644 (file)
@@ -235,36 +235,6 @@ class UserTest extends MediaWikiTestCase {
                ];
        }
 
-       /**
-        * Test, if for all rights a right- message exist,
-        * which is used on Special:ListGroupRights as help text
-        * Extensions and core
-        *
-        * @coversNothing
-        */
-       public function testAllRightsWithMessage() {
-               // Getting all user rights, for core: User::$mCoreRights, for extensions: $wgAvailableRights
-               $allRights = User::getAllRights();
-               $allMessageKeys = Language::getMessageKeysFor( 'en' );
-
-               $rightsWithMessage = [];
-               foreach ( $allMessageKeys as $message ) {
-                       // === 0: must be at beginning of string (position 0)
-                       if ( strpos( $message, 'right-' ) === 0 ) {
-                               $rightsWithMessage[] = substr( $message, strlen( 'right-' ) );
-                       }
-               }
-
-               sort( $allRights );
-               sort( $rightsWithMessage );
-
-               $this->assertEquals(
-                       $allRights,
-                       $rightsWithMessage,
-                       'Each user rights (core/extensions) has a corresponding right- message.'
-               );
-       }
-
        /**
         * Test User::editCount
         * @group medium
@@ -569,6 +539,9 @@ class UserTest extends MediaWikiTestCase {
         * @covers User::findUsersByGroup
         */
        public function testFindUsersByGroup() {
+               // FIXME: fails under postgres
+               $this->markTestSkippedIfDbType( 'postgres' );
+
                $users = User::findUsersByGroup( [] );
                $this->assertEquals( 0, iterator_count( $users ) );
 
@@ -661,7 +634,7 @@ class UserTest extends MediaWikiTestCase {
                $this->assertTrue( $user2->isBlocked() );
                // Non-strict type-check.
                $this->assertEquals( true, $user2->getBlock()->isAutoblocking(), 'Autoblock does not work' );
-               // Can't directly compare the objects becuase of member type differences.
+               // Can't directly compare the objects because of member type differences.
                // One day this will work: $this->assertEquals( $block, $user2->getBlock() );
                $this->assertEquals( $block->getId(), $user2->getBlock()->getId() );
                $this->assertEquals( $block->getExpiry(), $user2->getBlock()->getExpiry() );