dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Clarify MediaWikiTestCase::getSchemaOverrides()"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
auth
/
AuthManagerTest.php
diff --git
a/tests/phpunit/includes/auth/AuthManagerTest.php
b/tests/phpunit/includes/auth/AuthManagerTest.php
index
209ed55
..
e6a1d38
100644
(file)
--- a/
tests/phpunit/includes/auth/AuthManagerTest.php
+++ b/
tests/phpunit/includes/auth/AuthManagerTest.php
@@
-3,6
+3,7
@@
namespace MediaWiki\Auth;
use Config;
namespace MediaWiki\Auth;
use Config;
+use MediaWiki\Block\DatabaseBlock;
use MediaWiki\Session\SessionInfo;
use MediaWiki\Session\UserInfo;
use Psr\Log\LoggerInterface;
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();
}
\TestUser::setPasswordForUser( $user, 'UTBlockeePassword' );
$user->saveSettings();
}
- $oldBlock =
\
Block::newFromTarget( 'UTBlockee' );
+ $oldBlock =
Database
Block::newFromTarget( 'UTBlockee' );
if ( $oldBlock ) {
// An old block will prevent our new one from saving.
$oldBlock->delete();
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,
];
'expiry' => time() + 100500,
'createAccount' => true,
];
- $block = new
\
Block( $blockOptions );
+ $block = new
Database
Block( $blockOptions );
$block->insert();
$status = $this->manager->checkAccountCreatePermissions( $user );
$this->assertFalse( $status->isOK() );
$block->insert();
$status = $this->manager->checkAccountCreatePermissions( $user );
$this->assertFalse( $status->isOK() );
@@
-1456,7
+1457,7
@@
class AuthManagerTest extends \MediaWikiTestCase {
'expiry' => time() + 100500,
'createAccount' => true,
];
'expiry' => time() + 100500,
'createAccount' => true,
];
- $block = new
\
Block( $blockOptions );
+ $block = new
Database
Block( $blockOptions );
$block->insert();
$scopeVariable = new ScopedCallback( [ $block, 'delete' ] );
$status = $this->manager->checkAccountCreatePermissions( new \User );
$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();
// Test backoff
$cache = \ObjectCache::getLocalClusterInstance();
- $backoffKey =
wfMemc
Key( 'AuthManager', 'autocreate-failed', md5( $username ) );
+ $backoffKey =
$cache->make
Key( 'AuthManager', 'autocreate-failed', md5( $username ) );
$cache->set( $backoffKey, true );
$session->clear();
$user = \User::newFromName( $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();
// Test addToDatabase throws an exception
$cache = \ObjectCache::getLocalClusterInstance();
- $backoffKey =
wfMemc
Key( 'AuthManager', 'autocreate-failed', md5( $username ) );
+ $backoffKey =
$cache->make
Key( 'AuthManager', 'autocreate-failed', md5( $username ) );
$this->assertFalse( $cache->get( $backoffKey ), 'sanity check' );
$session->clear();
$user = $this->getMockBuilder( \User::class )
$this->assertFalse( $cache->get( $backoffKey ), 'sanity check' );
$session->clear();
$user = $this->getMockBuilder( \User::class )