30 $this->
makePage(
'FallbackLanguageTest-Full',
'ab' );
31 $this->
makePage(
'FallbackLanguageTest-Full',
'ru' );
32 $this->
makePage(
'FallbackLanguageTest-Full',
'de' );
35 $this->
makePage(
'FallbackLanguageTest-Partial',
'ru' );
36 $this->
makePage(
'FallbackLanguageTest-Partial',
'de' );
39 $this->
makePage(
'FallbackLanguageTest-ContLang',
'de' );
45 $this->
makePage(
'MessageCacheTest-FullKeyTest',
'ab' );
46 $this->
makePage(
'MessageCacheTest-FullKeyTest',
'ru' );
49 $this->
makePage(
'FallbackLanguageTest-NoDervContLang',
'de',
'de/none' );
62 if ( $content ===
null ) {
66 $title =
"$title/$lang";
69 $title = Title::newFromText( $title, NS_MEDIAWIKI );
72 $wikiPage->doEditContent( $contentHandler,
"$lang translation test case" );
82 $this->assertEquals( $expectedContent, $result,
"Message fallback failed." );
87 [
'FallbackLanguageTest-Full',
'ab',
'ab' ],
88 [
'FallbackLanguageTest-Partial',
'ab',
'ru' ],
89 [
'FallbackLanguageTest-ContLang',
'ab',
'de' ],
90 [
'FallbackLanguageTest-None',
'ab',
false ],
93 [
'sunday',
'ab',
'амҽыш' ],
96 [
'FallbackLanguageTest-NoDervContLang',
'de',
'de/none' ],
98 [
'FallbackLanguageTest-NoDervContLang',
'fit',
'de/none' ],
108 $oldText = $messageCache->get( $message );
111 $dbw->startAtomic( __METHOD__ );
112 $messageCache->replace( $uckey,
'Allez!' );
113 $this->assertEquals(
'Allez!',
114 $messageCache->getMsgFromNamespace( $uckey,
'de' ),
115 'Updates are reflected in-process immediately' );
116 $this->assertEquals(
'Allez!',
117 $messageCache->get( $message ),
118 'Updates are reflected in-process immediately' );
119 $this->
makePage(
'Go',
'de',
'Race!' );
120 $dbw->endAtomic( __METHOD__ );
122 $this->assertEquals( 0,
123 DeferredUpdates::pendingUpdatesCount(),
124 'Post-commit deferred update triggers a run of all updates' );
126 $this->assertEquals(
'Race!', $messageCache->get( $message ),
'Correct final contents' );
128 $this->
makePage(
'Go',
'de', $oldText );
129 $messageCache->replace( $uckey, $oldText );
130 $this->assertEquals( $oldText, $messageCache->get( $message ),
'Content restored' );
141 $this->assertEquals( $expectedContent, $result,
"Full key message fallback failed." );
146 [
'MessageCacheTest-FullKeyTest/ru',
'ru',
'ru' ],
147 [
'MessageCacheTest-FullKeyTest/ru',
'ab',
'ru' ],
148 [
'MessageCacheTest-FullKeyTest/ru/foo',
'ru',
false ],
157 $this->assertEquals( $expected, $actual );
166 [
'Foo bar',
'foo_bar' ],
168 [
'Ćab_e 3',
'ćab_e_3' ],
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
Database Cache MessageCache.
testFullKeyBehaviour( $message, $lang, $expectedContent)
There's a fallback case where the message key is given as fully qualified – this should ignore the pa...
provideMessagesForFallback()
provideMessagesForFullKeys()
testMessageFallbacks( $message, $lang, $expectedContent)
Test message fallbacks, bug #1495.
testNormalizeKey( $key, $expected)
provideNormalizeKey
makePage( $title, $lang, $content=null)
Helper function for addDBData – adds a simple page to the database.
configureLanguages()
Helper function – setup site language for testing.
static singleton()
Get the signleton instance of this class.
static normalizeKey( $key)
Normalize message key input.
Class representing a MediaWiki article and history.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
processing should stop and the error should be shown to the user * false
if(!isset( $args[0])) $lang