diff options
author | Brad Jorsch <bjorsch@wikimedia.org> | 2016-12-01 11:51:03 -0500 |
---|---|---|
committer | Brad Jorsch <bjorsch@wikimedia.org> | 2016-12-16 12:30:03 -0500 |
commit | 01a3b2b0bf6519922c4e13f5b68cf7cfb3547a21 (patch) | |
tree | 1bd7bcd60a36bc178192907f5c2001002610841e /tests/phpunit/includes/TitlePermissionTest.php | |
parent | 8373bf3fc0d901adda07807124b81e89f2c33fb2 (diff) | |
download | mediawikicore-01a3b2b0bf6519922c4e13f5b68cf7cfb3547a21.tar.gz mediawikicore-01a3b2b0bf6519922c4e13f5b68cf7cfb3547a21.zip |
Add the concept of "system blocks"
Blocks made for configured proxies, dnsbls, or the configured range
soft-blocks being added in I6c11a6b9 aren't real blocks stored in the
database. Let's actually flag these blocks as such and use a more
appropriate message when displaying them to the user.
Change-Id: I697e3eec2520792e98c193200c2b1c28c35bf382
Diffstat (limited to 'tests/phpunit/includes/TitlePermissionTest.php')
-rw-r--r-- | tests/phpunit/includes/TitlePermissionTest.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php index 5ecdf5613427..9121178a46e0 100644 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ b/tests/phpunit/includes/TitlePermissionTest.php @@ -787,5 +787,21 @@ class TitlePermissionTest extends MediaWikiLangTestCase { # $action != 'read' && $action != 'createaccount' && $user->isBlockedFrom( $this ) # $user->blockedFor() == '' # $user->mBlock->mExpiry == 'infinity' + + $this->user->mBlockedby = $this->user->getName(); + $this->user->mBlock = new Block( [ + 'address' => '127.0.8.1', + 'by' => $this->user->getId(), + 'reason' => 'no reason given', + 'timestamp' => $now, + 'auto' => false, + 'expiry' => 10, + 'systemBlock' => 'test', + ] ); + $this->assertEquals( [ [ 'systemblockedtext', + '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1', + 'Useruser', 'test', '23:00, 31 December 1969', '127.0.8.1', + $wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ], + $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); } } |