5c5ce5c2921a1054ef8bea73fb01e871c2c10cd9
6 class ArticleTablesTest
extends MediaWikiLangTestCase
{
9 * Make sure that T16404 doesn't strike again. We don't want
10 * templatelinks based on the user language when {{int:}} is used, only the
13 * @covers Title::getTemplateLinksFrom
14 * @covers Title::getLinksFrom
16 public function testTemplatelinksUsesContentLanguage() {
17 $title = Title
::newFromText( 'T16404' );
18 $page = WikiPage
::factory( $title );
20 $this->overrideUserPermissions( $user, [ 'createpage', 'edit', 'purge' ] );
21 $this->setContentLang( 'es' );
22 $this->setUserLang( 'fr' );
25 new WikitextContent( '{{:{{int:history}}}}' ),
26 'Test code for T16404',
31 $templates1 = $title->getTemplateLinksFrom();
33 $this->setUserLang( 'de' );
34 $page = WikiPage
::factory( $title ); // In order to force the re-rendering of the same wikitext
36 // We need an edit, a purge is not enough to regenerate the tables
38 new WikitextContent( '{{:{{int:history}}}}' ),
39 'Test code for T16404',
44 $templates2 = $title->getTemplateLinksFrom();
47 * @var Title[] $templates1
48 * @var Title[] $templates2
50 $this->assertEquals( $templates1, $templates2 );
51 $this->assertEquals( $templates1[0]->getFullText(), 'Historial' );