10 $name =
null, array $data = [], $dataName =
'',
$engineName =
null
12 parent::__construct( $name, $data, $dataName,
$engineName );
17 $msg =
'Language name translations are unavailable; ' .
18 'install Extension:CLDR or something similar';
20 'fetchLanguageName (en,ru)' => $msg,
21 'fetchLanguageName (ru,en)' => $msg,
22 'fetchLanguageNames (de)' => $msg,
23 'fetchLanguageNames ([[bogus]])' => $msg,
29 return parent::getTestModules() + [
30 'LanguageLibraryTests' => __DIR__ .
'/LanguageLibraryTests.lua',
38 $pp =
$engine->getParser()->getPreprocessor();
41 $wgContLang->sprintfDate(
's',
'20130101000000',
null, $ttl );
42 if ( $ttl ===
null ) {
43 $this->markTestSkipped(
"Language::sprintfDate does not set a TTL" );
48 $this->extraModules[
'Module:FormatDate'] =
'
50 function p.formatCurrentDate()
51 return mw.getContentLanguage():formatDate( "s" )
53 function p.formatSpecificDate()
54 return mw.getContentLanguage():formatDate( "s", "20130101000000" )
62 $frame = $pp->newFrame();
63 $module->invoke(
'formatCurrentDate', $frame );
64 $this->assertEquals( 1, $frame->getTTL(),
65 'TTL must be equal to 1 second when lang:formatDate( \'s\' ) is called' );
67 $frame = $pp->newFrame();
68 $module->invoke(
'formatSpecificDate', $frame );
69 $this->assertNull( $frame->getTTL(),
70 'TTL must not be set when lang:formatDate is called with a specific date' );