X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fauth%2FCheckBlocksSecondaryAuthenticationProviderTest.php;h=c38003660a000ba54f40b51e76f65751c8170004;hp=81cdc9dec90b9dad1e33bceccf8c2c96d0098b3e;hb=04d1aa3033f40a38d721f7f0e88b5bac440d2869;hpb=708f51c2c60b970549f463776faa38318fd11d21 diff --git a/tests/phpunit/includes/auth/CheckBlocksSecondaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/CheckBlocksSecondaryAuthenticationProviderTest.php index 81cdc9dec9..c38003660a 100644 --- a/tests/phpunit/includes/auth/CheckBlocksSecondaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/CheckBlocksSecondaryAuthenticationProviderTest.php @@ -2,12 +2,13 @@ namespace MediaWiki\Auth; +use MediaWiki\Block\DatabaseBlock; use Wikimedia\TestingAccessWrapper; /** * @group AuthManager * @group Database - * @covers MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider + * @covers \MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider */ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase { public function testConstructor() { @@ -68,7 +69,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest 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(); @@ -81,7 +82,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase 'expiry' => time() + 100500, 'createAccount' => true, ]; - $block = new \Block( $blockOptions ); + $block = new DatabaseBlock( $blockOptions ); $block->insert(); return $user; } @@ -154,7 +155,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase 'expiry' => time() + 100500, 'createAccount' => true, ]; - $block = new \Block( $blockOptions ); + $block = new DatabaseBlock( $blockOptions ); $block->insert(); $scopeVariable = new \Wikimedia\ScopedCallback( [ $block, 'delete' ] ); @@ -165,6 +166,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase $user->saveSettings(); } $this->setMwGlobals( [ 'wgUser' => $user ] ); + \RequestContext::getMain()->setUser( $user ); $newuser = \User::newFromName( 'RandomUser' ); $provider = new CheckBlocksSecondaryAuthenticationProvider(