diff options
author | Thalia <thalia.e.chan@googlemail.com> | 2019-05-13 15:18:07 +0100 |
---|---|---|
committer | Thalia <thalia.e.chan@googlemail.com> | 2019-05-28 12:20:48 +0100 |
commit | e65a5b58821873fdfdd15a4de6c1590fbea9a5fd (patch) | |
tree | 0478aeb190749f06549befce2734d6d9014239fd /tests/phpunit/includes/api/ApiMoveTest.php | |
parent | f4de088e6322d969b88edeb1c417549849c3803d (diff) | |
download | mediawikicore-e65a5b58821873fdfdd15a4de6c1590fbea9a5fd.tar.gz mediawikicore-e65a5b58821873fdfdd15a4de6c1590fbea9a5fd.zip |
Rename Block to MediaWiki\Block\DatabaseBlock
Keep Block as a deprecated class alias for DatabaseBlock.
Update calls to the Block constructor and Block static
methods from external classes.
Also update documentation in several places that refer to
blocks as Blocks.
Bug: T222737
Change-Id: I6d96b63ca0a84bee19486471e0a16a53a79d768a
Diffstat (limited to 'tests/phpunit/includes/api/ApiMoveTest.php')
-rw-r--r-- | tests/phpunit/includes/api/ApiMoveTest.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/phpunit/includes/api/ApiMoveTest.php b/tests/phpunit/includes/api/ApiMoveTest.php index d437a525a068..d880923d3fd1 100644 --- a/tests/phpunit/includes/api/ApiMoveTest.php +++ b/tests/phpunit/includes/api/ApiMoveTest.php @@ -1,5 +1,7 @@ <?php +use MediaWiki\Block\DatabaseBlock; + /** * @group API * @group Database @@ -132,9 +134,9 @@ class ApiMoveTest extends ApiTestCase { } 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', @@ -156,7 +158,7 @@ class ApiMoveTest extends ApiTestCase { $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(); |