Was reverted by I549810a4cd2e424cc4a438887d2f24614a24cc00 due to T224607. Original change by Vedmaka Wakalaka was Ia0d840b772ea5f20c9594ce151cc57adc270e48b. Original commit message: The following methods should are factored out of the User class into PermissionManager, leaving only deprecated stubs: - User::isAllowed -> PermissionManager::userHasRight - User::getRights -> PermissionManager::getUserPermissions - User::groupHasPermission -> PermissionManager::groupHasPermission - User::getGroupPermissions -> PermissionManager::getGroupPermissions -User::getGroupsWithPermission -> PermissionManager::getGroupsWithPermission - User::groupHasPermission -> PermissionManager::groupHasPermission - User::isEveryoneAllowed -> PermissionManager::isEveryoneAllowed - User::getAllRights -> PermissionManager::getAllPermissions Depends-On: I7909e9bd6bbfbd708c0a00b861a9b22a38c6665d Bug: T218558 Bug: T223294 Change-Id: I8899240378f636ea70f447616710516c0a3c5c31
53 lines
1.4 KiB
PHP
53 lines
1.4 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @group Database
|
|
*/
|
|
class ArticleTablesTest extends MediaWikiLangTestCase {
|
|
|
|
/**
|
|
* Make sure that T16404 doesn't strike again. We don't want
|
|
* templatelinks based on the user language when {{int:}} is used, only the
|
|
* content language.
|
|
*
|
|
* @covers Title::getTemplateLinksFrom
|
|
* @covers Title::getLinksFrom
|
|
*/
|
|
public function testTemplatelinksUsesContentLanguage() {
|
|
$title = Title::newFromText( 'T16404' );
|
|
$page = WikiPage::factory( $title );
|
|
$user = new User();
|
|
$this->overrideUserPermissions( $user, [ 'createpage', 'edit', 'purge' ] );
|
|
$this->setContentLang( 'es' );
|
|
$this->setUserLang( 'fr' );
|
|
|
|
$page->doEditContent(
|
|
new WikitextContent( '{{:{{int:history}}}}' ),
|
|
'Test code for T16404',
|
|
0,
|
|
false,
|
|
$user
|
|
);
|
|
$templates1 = $title->getTemplateLinksFrom();
|
|
|
|
$this->setUserLang( 'de' );
|
|
$page = WikiPage::factory( $title ); // In order to force the re-rendering of the same wikitext
|
|
|
|
// We need an edit, a purge is not enough to regenerate the tables
|
|
$page->doEditContent(
|
|
new WikitextContent( '{{:{{int:history}}}}' ),
|
|
'Test code for T16404',
|
|
EDIT_UPDATE,
|
|
false,
|
|
$user
|
|
);
|
|
$templates2 = $title->getTemplateLinksFrom();
|
|
|
|
/**
|
|
* @var Title[] $templates1
|
|
* @var Title[] $templates2
|
|
*/
|
|
$this->assertEquals( $templates1, $templates2 );
|
|
$this->assertEquals( $templates1[0]->getFullText(), 'Historial' );
|
|
}
|
|
}
|