Merge "rdbms: split out private LoadBalancer::getServerInfoStrict method"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiMoveTest.php
index b9c49b1..d880923 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use MediaWiki\Block\DatabaseBlock;
+
 /**
  * @group API
  * @group Database
@@ -17,6 +19,7 @@ class ApiMoveTest extends ApiTestCase {
        protected function assertMoved( $from, $to, $id, $opts = null ) {
                $opts = (array)$opts;
 
+               Title::clearCaches();
                $fromTitle = Title::newFromText( $from );
                $toTitle = Title::newFromText( $to );
 
@@ -131,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',
@@ -155,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();