X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTitlePermissionTest.php;h=e20cc7b12fb2a5ef54268a4bc59571597a81a6d7;hb=0a6f7f5796c412512858c94909b9bf98cf55abdd;hp=5ecdf561342728d0a953bba38c3251ad292e4da0;hpb=21463af0d8db7d7ea8e0e87e48e75cd3acb832b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php index 5ecdf56134..e20cc7b12f 100644 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ b/tests/phpunit/includes/TitlePermissionTest.php @@ -518,11 +518,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase { $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - $this->setUserPerm( 'editusercssjs' ); - $this->assertEquals( [ [ 'badaccess-group0' ] ], - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->setUserPerm( [ 'edituserjs', 'editusercss' ] ); $this->assertEquals( [ [ 'badaccess-group0' ] ], $this->title->getUserPermissionsErrors( 'bogus', @@ -787,5 +782,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 ) ); } }