namespace MediaWiki\Auth;
use Config;
+use MediaWiki\Block\DatabaseBlock;
use MediaWiki\Session\SessionInfo;
use MediaWiki\Session\UserInfo;
use Psr\Log\LoggerInterface;
\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();
'expiry' => time() + 100500,
'createAccount' => true,
];
- $block = new \Block( $blockOptions );
+ $block = new DatabaseBlock( $blockOptions );
$block->insert();
$status = $this->manager->checkAccountCreatePermissions( $user );
$this->assertFalse( $status->isOK() );
'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 );
// 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 );
// 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 )