X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fauth%2FAuthManagerTest.php;h=e6a1d3886c5ce4a54b02482efea247a1c637c2e8;hb=fa8df6062fbaf42cb110f1aaba915ff59a6621be;hp=209ed55fd4bb3c5959a8ebe94cb0e14da891a5c9;hpb=12b7e6f38ab852695ad2b1a63d9d64fc93365d8a;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/auth/AuthManagerTest.php b/tests/phpunit/includes/auth/AuthManagerTest.php index 209ed55fd4..e6a1d3886c 100644 --- a/tests/phpunit/includes/auth/AuthManagerTest.php +++ b/tests/phpunit/includes/auth/AuthManagerTest.php @@ -3,6 +3,7 @@ namespace MediaWiki\Auth; use Config; +use MediaWiki\Block\DatabaseBlock; use MediaWiki\Session\SessionInfo; use MediaWiki\Session\UserInfo; use Psr\Log\LoggerInterface; @@ -1430,7 +1431,7 @@ class AuthManagerTest extends \MediaWikiTestCase { \TestUser::setPasswordForUser( $user, 'UTBlockeePassword' ); $user->saveSettings(); } - $oldBlock = \Block::newFromTarget( 'UTBlockee' ); + $oldBlock = DatabaseBlock::newFromTarget( 'UTBlockee' ); if ( $oldBlock ) { // An old block will prevent our new one from saving. $oldBlock->delete(); @@ -1443,7 +1444,7 @@ class AuthManagerTest extends \MediaWikiTestCase { 'expiry' => time() + 100500, 'createAccount' => true, ]; - $block = new \Block( $blockOptions ); + $block = new DatabaseBlock( $blockOptions ); $block->insert(); $status = $this->manager->checkAccountCreatePermissions( $user ); $this->assertFalse( $status->isOK() ); @@ -1456,7 +1457,7 @@ class AuthManagerTest extends \MediaWikiTestCase { 'expiry' => time() + 100500, 'createAccount' => true, ]; - $block = new \Block( $blockOptions ); + $block = new DatabaseBlock( $blockOptions ); $block->insert(); $scopeVariable = new ScopedCallback( [ $block, 'delete' ] ); $status = $this->manager->checkAccountCreatePermissions( new \User ); @@ -2670,7 +2671,7 @@ class AuthManagerTest extends \MediaWikiTestCase { // Test backoff $cache = \ObjectCache::getLocalClusterInstance(); - $backoffKey = wfMemcKey( 'AuthManager', 'autocreate-failed', md5( $username ) ); + $backoffKey = $cache->makeKey( 'AuthManager', 'autocreate-failed', md5( $username ) ); $cache->set( $backoffKey, true ); $session->clear(); $user = \User::newFromName( $username ); @@ -2709,7 +2710,7 @@ class AuthManagerTest extends \MediaWikiTestCase { // Test addToDatabase throws an exception $cache = \ObjectCache::getLocalClusterInstance(); - $backoffKey = wfMemcKey( 'AuthManager', 'autocreate-failed', md5( $username ) ); + $backoffKey = $cache->makeKey( 'AuthManager', 'autocreate-failed', md5( $username ) ); $this->assertFalse( $cache->get( $backoffKey ), 'sanity check' ); $session->clear(); $user = $this->getMockBuilder( \User::class )