X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fauth%2FCheckBlocksSecondaryAuthenticationProviderTest.php;h=bbc11926799de437e18848af77fdbfbe84cd29bd;hb=b86593a2da96539ca60ac7011eda0faf4e9e00d9;hp=68f574b6b40331dc198f27fab396b629911ed059;hpb=72b9240497311a2fa5f5b76d9e8bb953dc59853f;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/auth/CheckBlocksSecondaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/CheckBlocksSecondaryAuthenticationProviderTest.php index 68f574b6b4..bbc1192679 100644 --- a/tests/phpunit/includes/auth/CheckBlocksSecondaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/CheckBlocksSecondaryAuthenticationProviderTest.php @@ -2,15 +2,17 @@ namespace MediaWiki\Auth; +use Wikimedia\TestingAccessWrapper; + /** * @group AuthManager * @group Database - * @covers MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider + * @covers \MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider */ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase { public function testConstructor() { $provider = new CheckBlocksSecondaryAuthenticationProvider(); - $providerPriv = \TestingAccessWrapper::newFromObject( $provider ); + $providerPriv = TestingAccessWrapper::newFromObject( $provider ); $config = new \HashConfig( [ 'BlockDisablesLogin' => false ] ); @@ -20,7 +22,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase $provider = new CheckBlocksSecondaryAuthenticationProvider( [ 'blockDisablesLogin' => true ] ); - $providerPriv = \TestingAccessWrapper::newFromObject( $provider ); + $providerPriv = TestingAccessWrapper::newFromObject( $provider ); $config = new \HashConfig( [ 'BlockDisablesLogin' => false ] ); @@ -74,6 +76,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase $blockOptions = [ 'address' => 'UTBlockee', 'user' => $user->getID(), + 'by' => $this->getTestSysop()->getUser()->getId(), 'reason' => __METHOD__, 'expiry' => time() + 100500, 'createAccount' => true, @@ -133,12 +136,12 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase ); $status = $provider->testUserForCreation( $blockedUser, AuthManager::AUTOCREATE_SOURCE_SESSION ); - $this->assertInstanceOf( 'StatusValue', $status ); + $this->assertInstanceOf( \StatusValue::class, $status ); $this->assertFalse( $status->isOK() ); $this->assertTrue( $status->hasMessage( 'cantcreateaccount-text' ) ); $status = $provider->testUserForCreation( $blockedUser, false ); - $this->assertInstanceOf( 'StatusValue', $status ); + $this->assertInstanceOf( \StatusValue::class, $status ); $this->assertFalse( $status->isOK() ); $this->assertTrue( $status->hasMessage( 'cantcreateaccount-text' ) ); } @@ -147,6 +150,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase $blockOptions = [ 'address' => '127.0.0.0/24', 'reason' => __METHOD__, + 'by' => $this->getTestSysop()->getUser()->getId(), 'expiry' => time() + 100500, 'createAccount' => true, ]; @@ -174,12 +178,12 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase $this->assertEquals( AuthenticationResponse::FAIL, $ret->status ); $status = $provider->testUserForCreation( $newuser, AuthManager::AUTOCREATE_SOURCE_SESSION ); - $this->assertInstanceOf( 'StatusValue', $status ); + $this->assertInstanceOf( \StatusValue::class, $status ); $this->assertFalse( $status->isOK() ); $this->assertTrue( $status->hasMessage( 'cantcreateaccount-range-text' ) ); $status = $provider->testUserForCreation( $newuser, false ); - $this->assertInstanceOf( 'StatusValue', $status ); + $this->assertInstanceOf( \StatusValue::class, $status ); $this->assertFalse( $status->isOK() ); $this->assertTrue( $status->hasMessage( 'cantcreateaccount-range-text' ) ); }