*/
class SpecialBlockTest extends SpecialPageTestBase {
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
protected function newSpecialPage() {
return new SpecialBlock();
$this->assertSame( (string)$block->getTarget(), $fields['Target']['default'] );
$this->assertSame( $block->isHardblock(), $fields['HardBlock']['default'] );
- $this->assertSame( $block->prevents( 'createaccount' ), $fields['CreateAccount']['default'] );
+ $this->assertSame( $block->isCreateAccountBlocked(), $fields['CreateAccount']['default'] );
$this->assertSame( $block->isAutoblocking(), $fields['AutoBlock']['default'] );
- $this->assertSame( $block->prevents( 'editownusertalk' ), $fields['DisableUTEdit']['default'] );
- $this->assertSame( $block->mReason, $fields['Reason']['default'] );
+ $this->assertSame( !$block->isUsertalkEditAllowed(), $fields['DisableUTEdit']['default'] );
+ $this->assertSame( $block->getReason(), $fields['Reason']['default'] );
$this->assertSame( 'infinite', $fields['Expiry']['default'] );
}
$this->assertTrue( $result );
$block = Block::newFromTarget( $badActor );
- $this->assertSame( $reason, $block->mReason );
+ $this->assertSame( $reason, $block->getReason() );
$this->assertSame( $expiry, $block->getExpiry() );
}
$this->assertTrue( $result );
$block = Block::newFromTarget( $badActor );
- $this->assertSame( $reason, $block->mReason );
+ $this->assertSame( $reason, $block->getReason() );
$this->assertSame( $expiry, $block->getExpiry() );
$this->assertSame( '1', $block->isAutoblocking() );
}
$this->assertTrue( $result );
$block = Block::newFromTarget( $badActor );
- $this->assertSame( $reason, $block->mReason );
+ $this->assertSame( $reason, $block->getReason() );
$this->assertSame( $expiry, $block->getExpiry() );
$this->assertCount( 2, $block->getRestrictions() );
$this->assertTrue( BlockRestriction::equals( $block->getRestrictions(), [
$this->assertTrue( $result );
$block = Block::newFromTarget( $badActor );
- $this->assertSame( $reason, $block->mReason );
+ $this->assertSame( $reason, $block->getReason() );
$this->assertSame( $expiry, $block->getExpiry() );
$this->assertFalse( $block->isSitewide() );
$this->assertCount( 2, $block->getRestrictions() );
$this->assertTrue( $result );
$block = Block::newFromTarget( $badActor );
- $this->assertSame( $reason, $block->mReason );
+ $this->assertSame( $reason, $block->getReason() );
$this->assertSame( $expiry, $block->getExpiry() );
$this->assertFalse( $block->isSitewide() );
$this->assertCount( 1, $block->getRestrictions() );
$this->assertTrue( $result );
$block = Block::newFromTarget( $badActor );
- $this->assertSame( $reason, $block->mReason );
+ $this->assertSame( $reason, $block->getReason() );
$this->assertSame( $expiry, $block->getExpiry() );
$this->assertFalse( $block->isSitewide() );
$this->assertCount( 0, $block->getRestrictions() );
$this->assertTrue( $result );
$block = Block::newFromTarget( $badActor );
- $this->assertSame( $reason, $block->mReason );
+ $this->assertSame( $reason, $block->getReason() );
$this->assertSame( $expiry, $block->getExpiry() );
$this->assertTrue( $block->isSitewide() );
$this->assertCount( 0, $block->getRestrictions() );
$expectedResult,
$reason
) {
+ $this->setMwGlobals( [
+ 'wgBlockDisablesLogin' => false,
+ ] );
$this->setGroupPermissions( 'sysop', 'unblockself', true );
$this->setGroupPermissions( 'user', 'block', true );
// Getting errors about creating users in db in provider.