X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FBlockTest.php;h=70715e26bddd1b4a719b886d537942d892354b7d;hb=1d17bbe56326f4e4a26a5da59d232bbac16aed15;hp=c422b515ccbcecc539c877a8e4069f133792192e;hpb=52e76843e268180a6f7add00f1105c42bf6a4ee8;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php index c422b515cc..70715e26bd 100644 --- a/tests/phpunit/includes/BlockTest.php +++ b/tests/phpunit/includes/BlockTest.php @@ -160,7 +160,7 @@ class BlockTest extends MediaWikiLangTestCase { 'enableAutoblock' => true, 'hideName' => true, 'blockEmail' => true, - 'byText' => 'MetaWikiUser', + 'byText' => 'm>MetaWikiUser', ]; $block = new Block( $blockOptions ); $block->insert(); @@ -214,7 +214,7 @@ class BlockTest extends MediaWikiLangTestCase { 'enableAutoblock' => true, 'hideName' => true, 'blockEmail' => true, - 'byText' => 'MetaWikiUser', + 'byText' => 'Meta>MetaWikiUser', ]; $block = new Block( $blockOptions ); @@ -230,8 +230,9 @@ class BlockTest extends MediaWikiLangTestCase { 'Correct blockee name' ); $this->assertEquals( $userId, $block->getTarget()->getId(), 'Correct blockee id' ); - $this->assertEquals( 'MetaWikiUser', $block->getBlocker(), 'Correct blocker name' ); - $this->assertEquals( 'MetaWikiUser', $block->getByName(), 'Correct blocker name' ); + $this->assertEquals( 'Meta>MetaWikiUser', $block->getBlocker()->getName(), + 'Correct blocker name' ); + $this->assertEquals( 'Meta>MetaWikiUser', $block->getByName(), 'Correct blocker name' ); $this->assertEquals( 0, $block->getBy(), 'Correct blocker id' ); } @@ -282,6 +283,7 @@ class BlockTest extends MediaWikiLangTestCase { ], ]; + $blocker = $this->getTestUser()->getUser(); foreach ( $blockList as $insBlock ) { $target = $insBlock['target']; @@ -293,7 +295,7 @@ class BlockTest extends MediaWikiLangTestCase { $block = new Block(); $block->setTarget( $target ); - $block->setBlocker( 'testblocker@global' ); + $block->setBlocker( $blocker ); $block->mReason = $insBlock['desc']; $block->mExpiry = 'infinity'; $block->prevents( 'createaccount', $insBlock['ACDisable'] ); @@ -425,7 +427,7 @@ class BlockTest extends MediaWikiLangTestCase { 'reason' => 'test system block', 'timestamp' => wfTimestampNow(), 'expiry' => $this->db->getInfinity(), - 'byText' => 'MetaWikiUser', + 'byText' => 'MediaWiki default', 'systemBlock' => 'test', 'enableAutoblock' => true, ];