Merge "Delete unused variable"
[lhc/web/wiklou.git] / tests / phpunit / includes / TitlePermissionTest.php
index cb5e1f8..11b9c01 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 
-use MediaWiki\Block\Restriction\PageRestriction;
 use MediaWiki\MediaWikiServices;
 
 /**
@@ -893,7 +892,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                        'wgEmailAuthentication' => true,
                ] );
 
-               $this->setUserPerm( [ 'createpage', 'edit', 'move', 'rollback', 'patrol', 'upload', 'purge' ] );
+               $this->setUserPerm( [ "createpage", "move" ] );
                $this->setTitle( NS_HELP, "test page" );
 
                # $wgEmailConfirmToEdit only applies to 'edit' action
@@ -965,24 +964,11 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                        'expiry' => 10,
                        'systemBlock' => 'test',
                ] );
-
-               $errors = [ [ 'systemblockedtext',
+               $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->assertEquals( $errors,
-                       $this->title->getUserPermissionsErrors( 'edit', $this->user ) );
-               $this->assertEquals( $errors,
+                               $wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ],
                        $this->title->getUserPermissionsErrors( 'move-target', $this->user ) );
-               $this->assertEquals( $errors,
-                       $this->title->getUserPermissionsErrors( 'rollback', $this->user ) );
-               $this->assertEquals( $errors,
-                       $this->title->getUserPermissionsErrors( 'patrol', $this->user ) );
-               $this->assertEquals( $errors,
-                       $this->title->getUserPermissionsErrors( 'upload', $this->user ) );
-               $this->assertEquals( [],
-                       $this->title->getUserPermissionsErrors( 'purge', $this->user ) );
 
                // partial block message test
                $this->user->mBlockedby = $this->user->getName();
@@ -995,39 +981,10 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                        'expiry' => 10,
                ] );
 
-               $this->assertEquals( [],
-                       $this->title->getUserPermissionsErrors( 'edit', $this->user ) );
-               $this->assertEquals( [],
-                       $this->title->getUserPermissionsErrors( 'move-target', $this->user ) );
-               $this->assertEquals( [],
-                       $this->title->getUserPermissionsErrors( 'rollback', $this->user ) );
-               $this->assertEquals( [],
-                       $this->title->getUserPermissionsErrors( 'patrol', $this->user ) );
-               $this->assertEquals( [],
-                       $this->title->getUserPermissionsErrors( 'upload', $this->user ) );
-               $this->assertEquals( [],
-                       $this->title->getUserPermissionsErrors( 'purge', $this->user ) );
-
-               $this->user->mBlock->setRestrictions( [
-                               ( new PageRestriction( 0, $this->title->getArticleID() ) )->setTitle( $this->title ),
-               ] );
-
-               $errors = [ [ 'blockedtext-partial',
+               $this->assertEquals( [ [ 'blockedtext-partial',
                                '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
                                'Useruser', null, '23:00, 31 December 1969', '127.0.8.1',
-                               $wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ];
-
-               $this->assertEquals( $errors,
-                       $this->title->getUserPermissionsErrors( 'edit', $this->user ) );
-               $this->assertEquals( $errors,
+                               $wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ],
                        $this->title->getUserPermissionsErrors( 'move-target', $this->user ) );
-               $this->assertEquals( $errors,
-                       $this->title->getUserPermissionsErrors( 'rollback', $this->user ) );
-               $this->assertEquals( $errors,
-                       $this->title->getUserPermissionsErrors( 'patrol', $this->user ) );
-               $this->assertEquals( [],
-                       $this->title->getUserPermissionsErrors( 'upload', $this->user ) );
-               $this->assertEquals( [],
-                       $this->title->getUserPermissionsErrors( 'purge', $this->user ) );
        }
 }