/**
* per T28425
+ * @covers Block::__construct
*/
public function testBug26425BlockTimestampDefaultsToTime() {
$user = $this->getUserForBlocking();
'enableAutoblock' => true,
'hideName' => true,
'blockEmail' => true,
- 'byText' => 'MetaWikiUser',
+ 'byText' => 'm>MetaWikiUser',
];
$block = new Block( $blockOptions );
$block->insert();
'enableAutoblock' => true,
'hideName' => true,
'blockEmail' => true,
- 'byText' => 'MetaWikiUser',
+ 'byText' => 'Meta>MetaWikiUser',
];
$block = new Block( $blockOptions );
'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' );
}
],
];
+ $blocker = $this->getTestUser()->getUser();
foreach ( $blockList as $insBlock ) {
$target = $insBlock['target'];
$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'] );
$this->assertEquals( $exResult, $block->mReason, 'Correct block type for XFF header ' . $xff );
}
+ /**
+ * @covers Block::__construct
+ */
public function testDeprecatedConstructor() {
$this->hideDeprecated( 'Block::__construct with multiple arguments' );
$username = 'UnthinkablySecretRandomUsername';
);
}
+ /**
+ * @covers Block::getSystemBlockType
+ * @covers Block::insert
+ * @covers Block::doAutoblock
+ */
public function testSystemBlocks() {
$user = $this->getUserForBlocking();
$this->addBlockForUser( $user );
'reason' => 'test system block',
'timestamp' => wfTimestampNow(),
'expiry' => $this->db->getInfinity(),
- 'byText' => 'MetaWikiUser',
+ 'byText' => 'MediaWiki default',
'systemBlock' => 'test',
'enableAutoblock' => true,
];