Merge "objectcache: make newFromId()/newWANcacheFromId()/getDefaultKeyspace() private"
[lhc/web/wiklou.git] / tests / phpunit / includes / TestUser.php
index 86f4ae7..ca2e99f 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Wraps the user object, so we can also retain full access to properties
  * like password if we log in via the API.
@@ -22,9 +24,7 @@ class TestUser {
 
        private function assertNotReal() {
                global $wgDBprefix;
-               if ( $wgDBprefix !== MediaWikiTestCase::DB_PREFIX &&
-                       $wgDBprefix !== MediaWikiTestCase::ORA_DB_PREFIX
-               ) {
+               if ( $wgDBprefix !== MediaWikiTestCase::DB_PREFIX ) {
                        throw new MWException( "Can't create user on real database" );
                }
        }
@@ -140,9 +140,8 @@ class TestUser {
                        throw new MWException( "Passed User has an ID but is not in the database?" );
                }
 
-               $passwordFactory = new PasswordFactory();
-               $passwordFactory->init( RequestContext::getMain()->getConfig() );
-               if ( !$passwordFactory->newFromCiphertext( $row->user_password )->equals( $password ) ) {
+               $passwordFactory = MediaWikiServices::getInstance()->getPasswordFactory();
+               if ( !$passwordFactory->newFromCiphertext( $row->user_password )->verify( $password ) ) {
                        $passwordHash = $passwordFactory->newFromPlaintext( $password );
                        $dbw->update(
                                'user',