Файловый менеджер - Редактировать - /var/www/html/mediawiki-1.43.1/extensions/CheckUser/tests/phpunit/integration/CheckUser/SpecialCheckUserLogTest.php
Ðазад
<?php namespace MediaWiki\CheckUser\Tests\Integration\CheckUser; use MediaWikiIntegrationTestCase; /** * Test class for SpecialCheckUserLog class * * @group CheckUser * @group Database * * @covers \MediaWiki\CheckUser\CheckUser\SpecialCheckUserLog */ class SpecialCheckUserLogTest extends MediaWikiIntegrationTestCase { /** * @dataProvider provideRequiredGroupAccess */ public function testRequiredRightsByGroup( $groups, $allowed ) { $checkUserLog = $this->getServiceContainer()->getSpecialPageFactory() ->getPage( 'CheckUserLog' ); if ( $checkUserLog === null ) { $this->fail( 'CheckUserLog special page does not exist' ); } $requiredRight = $checkUserLog->getRestriction(); if ( !is_array( $groups ) ) { $groups = [ $groups ]; } $rightsGivenInGroups = $this->getServiceContainer()->getGroupPermissionsLookup() ->getGroupPermissions( $groups ); if ( $allowed ) { $this->assertContains( $requiredRight, $rightsGivenInGroups, 'Groups/rights given to the test user should allow it to access the CheckUserLog.' ); } else { $this->assertNotContains( $requiredRight, $rightsGivenInGroups, 'Groups/rights given to the test user should not include access to the CheckUserLog.' ); } } public static function provideRequiredGroupAccess() { return [ 'No user groups' => [ '', false ], 'Checkuser only' => [ 'checkuser', true ], 'Checkuser and sysop' => [ [ 'checkuser', 'sysop' ], true ], ]; } /** * @dataProvider provideRequiredRights */ public function testRequiredRights( $groups, $allowed ) { if ( ( is_array( $groups ) && isset( $groups['checkuser-log'] ) ) || $groups === "checkuser-log" ) { $this->setGroupPermissions( [ 'checkuser-log' => [ 'checkuser-log' => true, 'read' => true ] ] ); } $this->testRequiredRightsByGroup( $groups, $allowed ); } public static function provideRequiredRights() { return [ 'No user groups' => [ '', false ], 'checkuser-log right only' => [ 'checkuser-log', true ], ]; } }
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка