<?php
+use MediaWiki\Block\DatabaseBlock;
+
/**
* @group API
* @group Database
}
public function testMoveWhileBlocked() {
- $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();