<?php
+use MediaWiki\Block\DatabaseBlock;
+
/**
* Tests for MediaWiki api.php?action=edit.
*
$count++;
/*
- * T43990: if the target page has a newer revision than the redirect, then editing the
- * redirect while specifying 'redirect' and *not* specifying 'basetimestamp' erroneously
- * caused an edit conflict to be detected.
- */
+ * T43990: if the target page has a newer revision than the redirect, then editing the
+ * redirect while specifying 'redirect' and *not* specifying 'basetimestamp' erroneously
+ * caused an edit conflict to be detected.
+ */
// assume NS_HELP defaults to wikitext
$name = "Help:ApiEditPageTest_testEditConflict_redirect_T43990_$count";
public function testEditWhileBlocked() {
$name = 'Help:' . ucfirst( __FUNCTION__ );
- $this->assertNull( Block::newFromTarget( '127.0.0.1' ), 'Sanity check' );
+ $this->assertNull( DatabaseBlock::newFromTarget( '127.0.0.1' ), 'Sanity check' );
- $block = new Block( [
+ $block = new DatabaseBlock( [
'address' => self::$users['sysop']->getUser()->getName(),
'by' => self::$users['sysop']->getUser()->getId(),
'reason' => 'Capriciousness',
$this->fail( 'Expected exception not thrown' );
} catch ( ApiUsageException $ex ) {
$this->assertSame( 'You have been blocked from editing.', $ex->getMessage() );
- $this->assertNotNull( Block::newFromTarget( '127.0.0.1' ), 'Autoblock spread' );
+ $this->assertNotNull( DatabaseBlock::newFromTarget( '127.0.0.1' ), 'Autoblock spread' );
} finally {
$block->delete();
self::$users['sysop']->getUser()->clearInstanceCache();