X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTitlePermissionTest.php;h=c7cbc7bdf4ad4ec4df1e80e4902f67e95c449ae9;hb=3ebfa0acfc60af9734161a20947b8fce6c19981e;hp=9144d0c34b986894f9d10207db51aa40672efa68;hpb=8fe0cf970401f2796ca39165a2d0a311b551c47a;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php index 9144d0c34b..c7cbc7bdf4 100644 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ b/tests/phpunit/includes/TitlePermissionTest.php @@ -2,6 +2,9 @@ /** * @group Database + * + * @covers Title::getUserPermissionsErrors + * @covers Title::getUserPermissionsErrorsInternal */ class TitlePermissionTest extends MediaWikiLangTestCase { @@ -44,7 +47,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase { date_default_timezone_set( $localZone ); $this->title = Title::makeTitle( NS_MAIN, "Main Page" ); - if ( !isset( $this->userUser ) || !( $this->userUser instanceOf User ) ) { + if ( !isset( $this->userUser ) || !( $this->userUser instanceof User ) ) { $this->userUser = User::newFromName( $this->userName ); if ( !$this->userUser->getID() ) { @@ -68,7 +71,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase { } } - function setUserPerm( $perm ) { + protected function setUserPerm( $perm ) { // Setting member variables is evil!!! if ( is_array( $perm ) ) { @@ -78,11 +81,11 @@ class TitlePermissionTest extends MediaWikiLangTestCase { } } - function setTitle( $ns, $title = "Main_Page" ) { + protected function setTitle( $ns, $title = "Main_Page" ) { $this->title = Title::makeTitle( $ns, $title ); } - function setUser( $userName = null ) { + protected function setUser( $userName = null ) { if ( $userName === 'anon' ) { $this->user = $this->anonUser; } elseif ( $userName === null || $userName === $this->userName ) { @@ -92,7 +95,11 @@ class TitlePermissionTest extends MediaWikiLangTestCase { } } - function testQuickPermissions() { + /** + * @todo This test method should be split up into separate test methods and + * data providers + */ + public function testQuickPermissions() { global $wgContLang; $prefix = $wgContLang->getFormattedNsText( NS_PROJECT ); @@ -320,7 +327,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase { } } - function runGroupPermissions( $action, $result, $result2 = null ) { + protected function runGroupPermissions( $action, $result, $result2 = null ) { global $wgGroupPermissions; if ( $result2 === null ) { @@ -348,7 +355,11 @@ class TitlePermissionTest extends MediaWikiLangTestCase { $this->assertEquals( $result2, $res ); } - function testSpecialsAndNSPermissions() { + /** + * @todo This test method should be split up into separate test methods and + * data providers + */ + public function testSpecialsAndNSPermissions() { global $wgNamespaceProtection; $this->setUser( $this->userName ); @@ -399,7 +410,11 @@ class TitlePermissionTest extends MediaWikiLangTestCase { $this->title->userCan( 'bogus', $this->user ) ); } - function testCssAndJavascriptPermissions() { + /** + * @todo This test method should be split up into separate test methods and + * data providers + */ + public function testCssAndJavascriptPermissions() { $this->setUser( $this->userName ); $this->setTitle( NS_USER, $this->userName . '/test.js' ); @@ -448,7 +463,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase { ); } - function runCSSandJSPermissions( $result0, $result1, $result2, $result3, $result4 ) { + protected function runCSSandJSPermissions( $result0, $result1, $result2, $result3, $result4 ) { $this->setUserPerm( '' ); $this->assertEquals( $result0, $this->title->getUserPermissionsErrors( 'bogus', @@ -485,7 +500,11 @@ class TitlePermissionTest extends MediaWikiLangTestCase { $this->user ) ); } - function testPageRestrictions() { + /** + * @todo This test method should be split up into separate test methods and + * data providers + */ + public function testPageRestrictions() { global $wgContLang; $prefix = $wgContLang->getFormattedNsText( NS_PROJECT ); @@ -576,7 +595,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase { $this->user ) ); } - function testCascadingSourcesRestrictions() { + public function testCascadingSourcesRestrictions() { $this->setTitle( NS_MAIN, "test page" ); $this->setUserPerm( array( "edit", "bogus" ) ); @@ -596,7 +615,11 @@ class TitlePermissionTest extends MediaWikiLangTestCase { $this->title->getUserPermissionsErrors( 'edit', $this->user ) ); } - function testActionPermissions() { + /** + * @todo This test method should be split up into separate test methods and + * data providers + */ + public function testActionPermissions() { $this->setUserPerm( array( "createpage" ) ); $this->setTitle( NS_MAIN, "test page" ); $this->title->mTitleProtection['pt_create_perm'] = ''; @@ -667,7 +690,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase { $this->title->userCan( 'move-target', $this->user ) ); } - function testUserBlock() { + public function testUserBlock() { global $wgEmailConfirmToEdit, $wgEmailAuthentication; $wgEmailConfirmToEdit = true; $wgEmailAuthentication = true;