Add PasswordFactory to MediaWikiServices
[lhc/web/wiklou.git] / tests / phpunit / includes / auth / TemporaryPasswordPrimaryAuthenticationProviderTest.php
index 1708f1c..8863aa2 100644 (file)
@@ -128,11 +128,10 @@ class TemporaryPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestC
                $user = self::getMutableTestUser()->getUser();
 
                $dbw = wfGetDB( DB_MASTER );
-
-               $passwordFactory = new \PasswordFactory();
-               $passwordFactory->init( \RequestContext::getMain()->getConfig() );
+               $config = MediaWikiServices::getInstance()->getMainConfig();
                // A is unsalted MD5 (thus fast) ... we don't care about security here, this is test only
-               $passwordFactory->setDefaultType( 'A' );
+               $passwordFactory = new \PasswordFactory( $config->get( 'PasswordConfig' ), 'A' );
+
                $pwhash = $passwordFactory->newFromPlaintext( 'password' )->toString();
 
                $provider = $this->getProvider();