X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fauth%2FLocalPasswordPrimaryAuthenticationProviderTest.php;h=72a03c311a641ba7dce559ab414965b899246401;hb=de623cbbc47cf9d0ac25847e52a04d49bf380026;hp=088dd00fe8680dfde67fb935ef0d5fb81872a901;hpb=59e7337ea612d03d08b67e6ada707e3d7ced738d;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php index 088dd00fe8..72a03c311a 100644 --- a/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php @@ -2,6 +2,8 @@ namespace MediaWiki\Auth; +use MediaWiki\MediaWikiServices; + /** * @group AuthManager * @group Database @@ -28,7 +30,7 @@ class LocalPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestCase } $config = new \MultiConfig( [ $this->config, - \ConfigFactory::getDefaultInstance()->makeConfig( 'main' ) + MediaWikiServices::getInstance()->getMainConfig() ] ); if ( !$this->manager ) { @@ -328,7 +330,6 @@ class LocalPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestCase AuthenticationResponse::newPass( $userName ), $provider->beginPrimaryAuthentication( $reqs ) ); - } /** @@ -450,7 +451,7 @@ class LocalPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestCase $changeReq->password = $newpass; $provider->providerChangeAuthenticationData( $changeReq ); - if ( $loginOnly ) { + if ( $loginOnly && $changed ) { $old = 'fail'; $new = 'fail'; $expectExpiry = null; @@ -645,7 +646,6 @@ class LocalPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestCase $this->assertNull( $provider->finishAccountCreation( $user, $user, $res2 ) ); $ret = $provider->beginPrimaryAuthentication( $reqs ); $this->assertEquals( AuthenticationResponse::PASS, $ret->status, 'new password is set' ); - } }