*/
class SpecialBlockTest extends SpecialPageTestBase {
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
protected function newSpecialPage() {
return new SpecialBlock();
public function testGetFormFields() {
$this->setMwGlobals( [
'wgEnablePartialBlocks' => false,
+ 'wgBlockAllowsUTEdit' => true,
] );
$page = $this->newSpecialPage();
$wrappedPage = TestingAccessWrapper::newFromObject( $page );
public function testMaybeAlterFormDefaults() {
$this->setMwGlobals( [
'wgEnablePartialBlocks' => false,
+ 'wgBlockAllowsUTEdit' => true,
] );
$block = $this->insertBlock();
$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->isUsertalkEditAllowed(), $fields['DisableUTEdit']['default'] );
$this->assertSame( $block->mReason, $fields['Reason']['default'] );
$this->assertSame( 'infinite', $fields['Expiry']['default'] );
}
new PageRestriction( 0, $pageSaturn->getId() ),
new PageRestriction( 0, $pageMars->getId() ),
new NamespaceRestriction( 0, NS_TALK ),
+ // Deleted page.
+ new PageRestriction( 0, 999999 ),
] );
$block->insert();
$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.