$this->assertEquals( $expected, $this->getLang()->formatTimePeriod( $seconds, $format ), $desc );
}
- function provideFormattableTimes() {
+ public static function provideFormattableTimes() {
return array(
array(
9.45,
/**
* Array format is ($len, $ellipsis, $input, $expected)
*/
- function provideHTMLTruncateData() {
+ public static function provideHTMLTruncateData() {
return array(
array( 0, 'XXX', "1234567890", "XXX" ),
array( 8, 'XXX', "1234567890", "12345XXX" ),
* and distributed as free software, under the GNU General Public Licence.
* http://www.bortzmeyer.org/gabuzomeu-parsing-language-tags.html
*/
- function provideWellFormedLanguageTags() {
+ public static function provideWellFormedLanguageTags() {
return array(
array( 'fr', 'two-letter code' ),
array( 'fr-latn', 'two-letter code with lower case script code' ),
* and distributed as free software, under the GNU General Public Licence.
* http://www.bortzmeyer.org/gabuzomeu-parsing-language-tags.html
*/
- function provideMalformedLanguageTags() {
+ public static function provideMalformedLanguageTags() {
return array(
array( 'f', 'language too short' ),
array( 'f-Latn', 'language too short with script' ),
);
}
- function provideLanguageCodes() {
+ public static function provideLanguageCodes() {
return array(
- array( 'fr' , 'Two letters, minor case' ),
- array( 'EN' , 'Two letters, upper case' ),
- array( 'tyv' , 'Three letters' ),
- array( 'tokipona' , 'long language code' ),
+ array( 'fr', 'Two letters, minor case' ),
+ array( 'EN', 'Two letters, upper case' ),
+ array( 'tyv', 'Three letters' ),
+ array( 'tokipona', 'long language code' ),
array( 'be-tarask', 'With dash' ),
array( 'Zh-classical', 'Begin with upper case, dash' ),
array( 'Be-x-old', 'With extension (two dashes)' ),
*/
function testKnownLanguageTag( $code, $message = '' ) {
$this->assertTrue(
- (bool) Language::isKnownLanguageTag( $code ),
+ (bool)Language::isKnownLanguageTag( $code ),
"validating code $code - $message"
);
}
- function provideKnownLanguageTags() {
+ public static function provideKnownLanguageTags() {
return array(
array( 'fr', 'simple code' ),
array( 'bat-smg', 'an MW legacy tag' ),
*/
function testKnownCldrLanguageTag() {
if ( !class_exists( 'LanguageNames' ) ) {
- $this->markTestSkipped( 'reason' );
+ $this->markTestSkipped( 'The LanguageNames class is not available. The cldr extension is probably not installed.' );
}
$this->assertTrue(
- (bool) Language::isKnownLanguageTag( 'pal' ),
+ (bool)Language::isKnownLanguageTag( 'pal' ),
'validating code "pal" an ancient language, which probably will not appear in Names.php, but appears in CLDR in English'
);
}
*/
function testUnknownLanguageTag( $code, $message = '' ) {
$this->assertFalse(
- (bool) Language::isKnownLanguageTag( $code ),
+ (bool)Language::isKnownLanguageTag( $code ),
"checking that code $code is invalid - $message"
);
}
- function provideUnknownLanguageTags() {
+ public static function provideUnknownLanguageTags() {
return array(
array( 'mw', 'non-existent two-letter code' ),
);
"sprintfDate('$format', '$ts'): $msg"
);
}
+
/**
* bug 33454. sprintfDate should always use UTC.
* @dataProvider provideSprintfDateSamples
date_default_timezone_set( $oldTZ );
}
- function provideSprintfDateSamples() {
+ public static function provideSprintfDateSamples() {
return array(
array(
'xiY',
);
}
- function provideFormatSizes() {
+ public static function provideFormatSizes() {
return array(
array(
0,
);
}
- function provideFormatBitrate() {
+ public static function provideFormatBitrate() {
return array(
array(
0,
- "0bps",
+ "0 bps",
"0 bits per second"
),
array(
999,
- "999bps",
+ "999 bps",
"999 bits per second"
),
array(
1000,
- "1kbps",
+ "1 kbps",
"1 kilobit per second"
),
array(
1000 * 1000,
- "1Mbps",
+ "1 Mbps",
"1 megabit per second"
),
array(
pow( 10, 9 ),
- "1Gbps",
+ "1 Gbps",
"1 gigabit per second"
),
array(
pow( 10, 12 ),
- "1Tbps",
+ "1 Tbps",
"1 terabit per second"
),
array(
pow( 10, 15 ),
- "1Pbps",
+ "1 Pbps",
"1 petabit per second"
),
array(
pow( 10, 18 ),
- "1Ebps",
+ "1 Ebps",
"1 exabit per second"
),
array(
pow( 10, 21 ),
- "1Zbps",
+ "1 Zbps",
"1 zetabit per second"
),
array(
pow( 10, 24 ),
- "1Ybps",
+ "1 Ybps",
"1 yottabit per second"
),
array(
pow( 10, 27 ),
- "1,000Ybps",
+ "1,000 Ybps",
"1,000 yottabits per second"
),
);
}
-
/**
* @dataProvider provideFormatDuration
*/
);
}
- function provideFormatDuration() {
+ public static function provideFormatDuration() {
return array(
array(
0,
function testCheckTitleEncoding( $s ) {
$this->assertEquals(
$s,
- $this->getLang()->checkTitleEncoding($s),
+ $this->getLang()->checkTitleEncoding( $s ),
"checkTitleEncoding('$s')"
);
}
- function provideCheckTitleEncodingData() {
- return array (
+ public static function provideCheckTitleEncodingData() {
+ return array(
array( "" ),
array( "United States of America" ), // 7bit ASCII
array( rawurldecode( "S%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e" ) ),
);
}
- function provideRomanNumeralsData() {
+ public static function provideRomanNumeralsData() {
return array(
array( 1, 'I' ),
array( 2, 'II' ),
array( 7000, 'MMMMMMM' ),
array( 8000, 'MMMMMMMM' ),
array( 9000, 'MMMMMMMMM' ),
- array( 9999, 'MMMMMMMMMCMXCIX'),
+ array( 9999, 'MMMMMMMMMCMXCIX' ),
array( 10000, 'MMMMMMMMMM' ),
);
}
$this->assertEquals( $expected, $chosen );
}
- function providePluralData() {
+ public static function providePluralData() {
+ // Params are: [expected text, number given, [the plural forms]]
return array(
+ array( 'plural', 0, array(
+ 'singular', 'plural'
+ ) ),
array( 'explicit zero', 0, array(
'0=explicit zero', 'singular', 'plural'
) ),
array( 'plural', 3, array(
'0=explicit zero', '1=explicit one', 'singular', 'plural'
) ),
+ array( 'explicit eleven', 11, array(
+ 'singular', 'plural', '11=explicit eleven',
+ ) ),
+ array( 'plural', 12, array(
+ 'singular', 'plural', '11=explicit twelve',
+ ) ),
+ array( 'plural', 12, array(
+ 'singular', 'plural', '=explicit form',
+ ) ),
+ array( 'other', 2, array(
+ 'kissa=kala', '1=2=3', 'other',
+ ) ),
);
}
$this->assertEquals( $expected, $lang->translateBlockExpiry( $str ), $desc );
}
- function provideTranslateBlockExpiry() {
+ public static function provideTranslateBlockExpiry() {
return array(
array( '2 hours', '2 hours', 'simple data from ipboptions' ),
array( 'indefinite', 'infinite', 'infinite from ipboptions' ),
);
}
- function provideCommafyData() {
+ public static function provideCommafyData() {
return array(
array( 1, '1' ),
array( 10, '10' ),
$s = $lang->getMessageFromDB( 'word-separator' );
$c = $lang->getMessageFromDB( 'comma-separator' );
- $this->assertEquals( '', $lang->listToText( array( ) ) );
+ $this->assertEquals( '', $lang->listToText( array() ) );
$this->assertEquals( 'a', $lang->listToText( array( 'a' ) ) );
$this->assertEquals( "a{$and}{$s}b", $lang->listToText( array( 'a', 'b' ) ) );
$this->assertEquals( "a{$c}b{$and}{$s}c", $lang->listToText( array( 'a', 'b', 'c' ) ) );
$this->assertEquals( $expected, Language::isSupportedLanguage( $code ), $comment );
}
- static function provideIsSupportedLanguage() {
+ public static function provideIsSupportedLanguage() {
return array(
array( 'en', true, 'is supported language' ),
array( 'fi', true, 'is supported language' ),