X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fuser%2FLocalIdLookupTest.php;h=0e4674455c484308e8ba9339b45a59382ad0bb3e;hb=29bee071b23832173a55364453d3132a2fe26101;hp=58441f095f552db0627427d9a0ae9397dc841cbb;hpb=93350da7f1ab397b87c3ac3073ddfc1c857b272e;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/user/LocalIdLookupTest.php b/tests/phpunit/includes/user/LocalIdLookupTest.php index 58441f095f..0e4674455c 100644 --- a/tests/phpunit/includes/user/LocalIdLookupTest.php +++ b/tests/phpunit/includes/user/LocalIdLookupTest.php @@ -1,5 +1,8 @@ getUser(); - $block = new Block( [ + $block = new DatabaseBlock( [ 'address' => $this->localUsers[2]->getName(), 'by' => $sysop->getId(), 'reason' => __METHOD__, @@ -29,7 +32,7 @@ class LocalIdLookupTest extends MediaWikiTestCase { ] ); $block->insert(); - $block = new Block( [ + $block = new DatabaseBlock( [ 'address' => $this->localUsers[3]->getName(), 'by' => $sysop->getId(), 'reason' => __METHOD__, @@ -45,12 +48,12 @@ class LocalIdLookupTest extends MediaWikiTestCase { public function testLookupCentralIds() { $lookup = new LocalIdLookup(); - + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); $user1 = $this->getLookupUser(); $user2 = User::newFromName( 'UTLocalIdLookup2' ); - $this->assertTrue( $user1->isAllowed( 'hideuser' ), 'sanity check' ); - $this->assertFalse( $user2->isAllowed( 'hideuser' ), 'sanity check' ); + $this->assertTrue( $permissionManager->userHasRight( $user1, 'hideuser' ), 'sanity check' ); + $this->assertFalse( $permissionManager->userHasRight( $user2, 'hideuser' ), 'sanity check' ); $this->assertSame( [], $lookup->lookupCentralIds( [] ) ); @@ -74,11 +77,12 @@ class LocalIdLookupTest extends MediaWikiTestCase { public function testLookupUserNames() { $lookup = new LocalIdLookup(); + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); $user1 = $this->getLookupUser(); $user2 = User::newFromName( 'UTLocalIdLookup2' ); - $this->assertTrue( $user1->isAllowed( 'hideuser' ), 'sanity check' ); - $this->assertFalse( $user2->isAllowed( 'hideuser' ), 'sanity check' ); + $this->assertTrue( $permissionManager->userHasRight( $user1, 'hideuser' ), 'sanity check' ); + $this->assertFalse( $permissionManager->userHasRight( $user2, 'hideuser' ), 'sanity check' ); $this->assertSame( [], $lookup->lookupUserNames( [] ) );