Merge "rdbms: avoid LoadBalancer::getConnection waste when using $groups"
[lhc/web/wiklou.git] / tests / phpunit / structure / PasswordPolicyStructureTest.php
index b263762..d7f865d 100644 (file)
@@ -1,8 +1,5 @@
 <?php
 
-/**
- * @coversNothing
- */
 class PasswordPolicyStructureTest extends MediaWikiTestCase {
 
        public function provideChecks() {
@@ -18,14 +15,17 @@ class PasswordPolicyStructureTest extends MediaWikiTestCase {
 
                // This won't actually find all flags, just the ones in use. Can't really be helped,
                // other than adding the core flags here.
-               $flags = [ 'forceChange' ];
+               $flags = [ 'forceChange', 'suggestChangeOnLogin' ];
                foreach ( $wgPasswordPolicy['policies'] as $group => $checks ) {
                        foreach ( $checks as $check => $settings ) {
                                if ( is_array( $settings ) ) {
-                                       $flags = array_merge( $flags, array_diff( $settings, [ 'value' ] ) );
+                                       $flags = array_unique(
+                                               array_merge( $flags, array_diff( array_keys( $settings ), [ 'value' ] ) )
+                                       );
                                }
                        }
                }
+
                foreach ( $flags as $flag ) {
                        yield [ $flag ];
                }