rdbms: make connection counting logic in LoadBalancer less stateful
[lhc/web/wiklou.git] / tests / phpunit / includes / TitlePermissionTest.php
index f7ffe8d..e09546e 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 
+use MediaWiki\Block\DatabaseBlock;
 use MediaWiki\Block\Restriction\PageRestriction;
+use MediaWiki\Block\SystemBlock;
 use MediaWiki\MediaWikiServices;
 
 /**
@@ -891,6 +893,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                $this->setMwGlobals( [
                        'wgEmailConfirmToEdit' => true,
                        'wgEmailAuthentication' => true,
+                       'wgBlockDisablesLogin' => false,
                ] );
                $this->overrideMwServices();
 
@@ -918,7 +921,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                $prev = time();
                $now = time() + 120;
                $this->user->mBlockedby = $this->user->getId();
-               $this->user->mBlock = new Block( [
+               $this->user->mBlock = new DatabaseBlock( [
                        'address' => '127.0.8.1',
                        'by' => $this->user->getId(),
                        'reason' => 'no reason given',
@@ -941,7 +944,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                global $wgLocalTZoffset;
                $wgLocalTZoffset = -60;
                $this->user->mBlockedby = $this->user->getName();
-               $this->user->mBlock = new Block( [
+               $this->user->mBlock = new DatabaseBlock( [
                        'address' => '127.0.8.1',
                        'by' => $this->user->getId(),
                        'reason' => 'no reason given',
@@ -959,19 +962,17 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                #   $user->mBlock->mExpiry == 'infinity'
 
                $this->user->mBlockedby = $this->user->getName();
-               $this->user->mBlock = new Block( [
+               $this->user->mBlock = new SystemBlock( [
                        'address' => '127.0.8.1',
                        'by' => $this->user->getId(),
                        'reason' => 'no reason given',
                        'timestamp' => $now,
-                       'auto' => false,
-                       'expiry' => 10,
                        'systemBlock' => 'test',
                ] );
 
                $errors = [ [ 'systemblockedtext',
                                '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
-                               'Useruser', 'test', '23:00, 31 December 1969', '127.0.8.1',
+                               'Useruser', 'test', 'infinite', '127.0.8.1',
                                $wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ];
 
                $this->assertEquals( $errors,
@@ -989,7 +990,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
 
                // partial block message test
                $this->user->mBlockedby = $this->user->getName();
-               $this->user->mBlock = new Block( [
+               $this->user->mBlock = new DatabaseBlock( [
                        'address' => '127.0.8.1',
                        'by' => $this->user->getId(),
                        'reason' => 'no reason given',
@@ -1073,7 +1074,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
 
                $now = time();
                $this->user->mBlockedby = $this->user->getName();
-               $this->user->mBlock = new Block( [
+               $this->user->mBlock = new DatabaseBlock( [
                        'address' => '127.0.8.1',
                        'by' => $this->user->getId(),
                        'reason' => 'no reason given',