MediaWiki  1.23.1
ArticleTablesTest.php
Go to the documentation of this file.
1 <?php
2 
7 
13  public function testbug14404() {
14  $title = Title::newFromText( 'Bug 14404' );
15  $page = WikiPage::factory( $title );
16  $user = new User();
17  $user->mRights = array( 'createpage', 'edit', 'purge' );
18  $this->setMwGlobals( 'wgLanguageCode', 'es' );
19  $this->setMwGlobals( 'wgContLang', Language::factory( 'es' ) );
20  $this->setMwGlobals( 'wgLang', Language::factory( 'fr' ) );
21 
22  $page->doEditContent(
23  new WikitextContent( '{{:{{int:history}}}}' ),
24  'Test code for bug 14404',
25  0,
26  false,
27  $user
28  );
29  $templates1 = $title->getTemplateLinksFrom();
30 
31  $this->setMwGlobals( 'wgLang', Language::factory( 'de' ) );
32  $page = WikiPage::factory( $title ); // In order to force the re-rendering of the same wikitext
33 
34  // We need an edit, a purge is not enough to regenerate the tables
35  $page->doEditContent(
36  new WikitextContent( '{{:{{int:history}}}}' ),
37  'Test code for bug 14404',
39  false,
40  $user
41  );
42  $templates2 = $title->getTemplateLinksFrom();
43 
48  $this->assertEquals( $templates1, $templates2 );
49  $this->assertEquals( $templates1[0]->getFullText(), 'Historial' );
50  }
51 }
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:189
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
WikiPage\factory
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
Definition: WikiPage.php:103
MediaWikiTestCase\setMwGlobals
setMwGlobals( $pairs, $value=null)
Definition: MediaWikiTestCase.php:302
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
WikitextContent
Content object for wiki text pages.
Definition: WikitextContent.php:33
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
EDIT_UPDATE
const EDIT_UPDATE
Definition: Defines.php:190
ArticleTablesTest
@group Database
Definition: ArticleTablesTest.php:6
MediaWikiLangTestCase
Base class that store and restore the Language objects.
Definition: MediaWikiLangTestCase.php:6
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
ArticleTablesTest\testbug14404
testbug14404()
@covers Title::getTemplateLinksFrom @covers Title::getLinksFrom
Definition: ArticleTablesTest.php:13
User
User
Definition: All_system_messages.txt:425
Language\factory
static factory( $code)
Get a cached or new language object for a given language code.
Definition: Language.php:184