Follows-up I9d2b148e57 (including phpunit/languages this time).
Bug: 46434
Change-Id: I30e5efcd88c516121c454676bd7a18f9b7c8fca6
$this->assertEquals( $expected, $index, "wfMakeUrlIndexes(\"$url\")" );
}
- function provideMakeUrlIndexes() {
+ public static function provideMakeUrlIndexes() {
return array(
array(
// just a regular :)
$this->assertEquals( $expected, $actual, $description );
}
- function provideWfMatchesDomainList() {
+ public static function provideWfMatchesDomainList() {
$a = array();
$protocols = array( 'HTTP' => 'http:', 'HTTPS' => 'https:', 'protocol-relative' => '' );
foreach ( $protocols as $pDesc => $p ) {
$this->assertEquals( $expected, $actual, $description );
}
- function provideWfShellMaintenanceCmdList() {
+ public static function provideWfShellMaintenanceCmdList() {
global $wgPhpCli;
return array(
array( 'eval.php', array( '--help', '--test' ), array(),
$this->assertEquals( $expected, wfIsBadImage( $name, $title, $blacklist ), $desc );
}
- function provideWfIsBadImageList() {
+ public static function provideWfIsBadImageList() {
$blacklist = '* [[File:Bad.jpg]] except [[Nasty page]]';
return array(
array( 'Bad.jpg', false, $blacklist, true,
/**
* Array format is ($code, $expected)
*/
- function provideLanguageCodes() {
+ public static function provideLanguageCodes() {
return array(
// Extracted from BCP47 (list not exhaustive)
# 2.1.1
"wfBaseName('$fullpath') => '$basename'" );
}
- function providePaths() {
+ public static function providePaths() {
return array(
array( '', '' ),
array( '/', '' ),
);
}
- function provideABunchOfShorthands() {
+ public static function provideABunchOfShorthands() {
return array(
array( '', -1, 'Empty string' ),
array( ' ', -1, 'String of spaces' ),
$this->assertEquals( $output, wfTimestamp( $format, $input ), $desc );
}
- function provideNormalTimestamps() {
+ public static function provideNormalTimestamps() {
$t = gmmktime( 12, 34, 56, 1, 15, 2001 );
return array(
// TS_UNIX
$this->assertEquals( $output, wfTimestamp( $format, $input ), $desc );
}
- function provideOldTimestamps() {
+ public static function provideOldTimestamps() {
return array(
array( '19011213204554', TS_RFC2822, 'Fri, 13 Dec 1901 20:45:54 GMT', 'Earliest time according to php documentation' ),
array( '20380119031407', TS_RFC2822, 'Tue, 19 Jan 2038 03:14:07 GMT', 'Latest 32 bit time' ),
$this->assertEquals( $output, wfTimestamp( TS_MW, $input ), $desc );
}
- function provideHttpDates() {
+ public static function provideHttpDates() {
return array(
array( 'Sun, 06 Nov 1994 08:49:37 GMT', '19941106084937', 'RFC 822 date' ),
array( 'Sunday, 06-Nov-94 08:49:37 GMT', '19941106084937', 'RFC 850 date' ),
* List of input element types values introduced by HTML5
* Full list at http://www.w3.org/TR/html-markup/input.html
*/
- function provideHtml5InputTypes() {
+ public static function provideHtml5InputTypes() {
$types = array(
'datetime',
'datetime-local',
);
}
- function provideCasesForUserLink() {
+ public static function provideCasesForUserLink() {
# Format:
# - expected
# - userid
/**
* Provide HTML5 tags
*/
- function provideHtml5Tags() {
+ public static function provideHtml5Tags() {
$ESCAPED = true; # We want tag to be escaped
$VERBATIM = false; # We want to keep the tag
return array(
);
}
- function provideTagAttributesToDecode() {
+ public static function provideTagAttributesToDecode() {
return array(
array( array( 'foo' => 'bar' ), 'foo=bar', 'Unquoted attribute' ),
array( array( 'foo' => 'bar' ), ' foo = bar ', 'Spaced attribute' ),
/**
* Test for support or lack of support for specific attributes in the attribute whitelist.
*/
- function provideAttributeSupport() {
+ public static function provideAttributeSupport() {
/** array( <attributes>, <expected>, <message> ) */
return array(
array( 'div', ' role="presentation"', ' role="presentation"', 'Support for WAI-ARIA\'s role="presentation".' ),
* Markus Kuhn:
* http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
*/
- function provideStringsForIsUtf8Check() {
+ public static function provideStringsForIsUtf8Check() {
// Expected return values for StringUtils::isUtf8()
$PASS = true;
$FAIL = false;
);
}
- function provideCasesForGetpageviewlanguage() {
+ public static function provideCasesForGetpageviewlanguage() {
# Format:
# - expected
# - Title name
);
}
- function provideBaseTitleCases() {
+ public static function provideBaseTitleCases() {
return array(
# Title, expected base, optional message
array( 'User:John_Doe/subOne/subTwo', 'John Doe/subOne' ),
);
}
- function provideSubpageTitleCases() {
+ public static function provideSubpageTitleCases() {
return array(
# Title, expected base, optional message
array( 'User:John_Doe/subOne/subTwo', 'subTwo' ),
/**
* Just provide the 'block' and 'unblock' action to test both API calls
*/
- function provideBlockUnblockAction() {
+ public static function provideBlockUnblockAction() {
return array(
array( 'block' ),
array( 'unblock' ),
$this->assertEquals( $data, $page->getContent()->serialize() );
}
- static function provideEditAppend() {
+ public static function provideEditAppend() {
return array(
array( #0: append
'foo', 'append', 'bar', "foobar"
$this->assertEquals( $expectedContent, $result, "Message fallback failed." );
}
- function provideMessagesForFallback() {
+ public static function provideMessagesForFallback() {
return array(
array( 'FallbackLanguageTest-Full', 'ab', 'ab' ),
array( 'FallbackLanguageTest-Partial', 'ab', 'ru' ),
$this->assertEquals( $expectedContent, $result, "Full key message fallback failed." );
}
- function provideMessagesForFullKeys() {
+ public static function provideMessagesForFullKeys() {
return array(
array( 'MessageCacheTest-FullKeyTest/ru', 'ru', 'ru' ),
array( 'MessageCacheTest-FullKeyTest/ru', 'ab', 'ru' ),
"FileBackend::isStoragePath on path '$path'" );
}
- function provider_testIsStoragePath() {
+ public static function provider_testIsStoragePath() {
return array(
array( 'mwstore://', true ),
array( 'mwstore://backend', true ),
"FileBackend::splitStoragePath on path '$path'" );
}
- function provider_testSplitStoragePath() {
+ public static function provider_testSplitStoragePath() {
return array(
array( 'mwstore://backend/container', array( 'backend', 'container', '' ) ),
array( 'mwstore://backend/container/', array( 'backend', 'container', '' ) ),
"FileBackend::normalizeStoragePath on path '$path'" );
}
- function provider_normalizeStoragePath() {
+ public static function provider_normalizeStoragePath() {
return array(
array( 'mwstore://backend/container', 'mwstore://backend/container' ),
array( 'mwstore://backend/container/', 'mwstore://backend/container' ),
"FileBackend::parentStoragePath on path '$path'" );
}
- function provider_testParentStoragePath() {
+ public static function provider_testParentStoragePath() {
return array(
array( 'mwstore://backend/container/path/to/obj', 'mwstore://backend/container/path/to' ),
array( 'mwstore://backend/container/path/to', 'mwstore://backend/container/path' ),
}
}
- function provider_testConcatenate() {
+ public static function provider_testConcatenate() {
$cases = array();
$rand = mt_rand( 0, 2000000000 ) . time();
}
}
- function provider_testGetFileStat() {
+ public static function provider_testGetFileStat() {
$cases = array();
$base = self::baseStorePath();
}
}
- function provider_testGetFileContents() {
+ public static function provider_testGetFileContents() {
$cases = array();
$base = self::baseStorePath();
$tmpFile->bind( $obj );
}
- function provider_testGetLocalCopy() {
+ public static function provider_testGetLocalCopy() {
$cases = array();
$base = self::baseStorePath();
}
}
- function provider_testGetLocalReference() {
+ public static function provider_testGetLocalReference() {
$cases = array();
$base = self::baseStorePath();
}
}
- function provider_testGetFileHttpUrl() {
+ public static function provider_testGetFileHttpUrl() {
$cases = array();
$base = self::baseStorePath();
$this->tearDownFiles();
}
- function provider_testPrepareAndClean() {
+ public static function provider_testPrepareAndClean() {
$base = self::baseStorePath();
return array(
array( "$base/unittest-cont1/e/a/z/some_file1.txt", true ),
/**
* Provider for testFormat()
*/
- function provideDocFormattingTests() {
+ public static function provideDocFormattingTests() {
# Format: (expected string, unformattedText string, optional message)
return array(
# Escape some wikitext
$this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" );
}
- function provider_queueLists() {
+ public static function provider_queueLists() {
return array(
array( 'queueRand', false, 'Random queue without ack()' ),
array( 'queueRandTTL', true, 'Random queue with ack()' ),
);
}
- function provider_fifoQueueLists() {
+ public static function provider_fifoQueueLists() {
return array(
array( 'queueFifo', false, 'Ordered queue without ack()' ),
array( 'queueFifoTTL', true, 'Ordered queue with ack()' )
}
}
- function provideValuesToEncode() {
+ public static function provideValuesToEncode() {
$obj = new stdClass();
$obj->property = 'value';
$obj->property2 = null;
);
}
- function provideValuesToDecode() {
+ public static function provideValuesToDecode() {
return array(
array( '1', 'basic integer' ),
array( '-1', 'negative integer' ),
* These transform cases are tested *in both directions*
* No need to declare a principle twice in both directions here.
*/
- function provideTransformCases() {
+ public static function provideTransformCases() {
return array(
// Property keys
array(
* If both ways can be tested, either put both versions in here or move
* it to provideTransformCases().
*/
- function provideTransformAdvancedCases() {
+ public static function provideTransformAdvancedCases() {
$bgPairs = array(
# [ - _ . ] <-> [ left right ltr rtl ]
'foo.jpg' => 'foo.jpg',
* Cases that are currently failing, but
* should be looked at in the future as enhancements and/or bug fix
*/
- function provideTransformBrokenCases() {
+ public static function provideTransformBrokenCases() {
return array(
// Guard against selectors that look flippable
array(
$this->assertEquals( $expectedOutput, $minified, 'Minified output should be in the form expected.' );
}
- function provideMinifyCases() {
+ public static function provideMinifyCases() {
return array(
// Whitespace
array( "\r\t\f \v\n\r", "" ),
$this->assertEquals( $expectedOutput, $remapped, 'CSSMin::remap should return the expected url form.' . $messageAdd );
}
- function provideRemapCases() {
+ public static function provideRemapCases() {
// Parameter signature:
// CSSMin::remap( $code, $local, $remote, $embedData = true )
return array(
$this->testMinifyOutput( $code, $expectedOutput );
}
- function provideStringCases() {
+ public static function provideStringCases() {
return array(
// String values should be respected
// - More than one space in a string value
class JavaScriptMinifierTest extends MediaWikiTestCase {
- function provideCases() {
+ public static function provideCases() {
return array(
// Basic whitespace and comments that should be stripped entirely
$this->assertEquals( $expectedOutput, $minified, "Minified output should be in the form expected." );
}
- function provideBug32548() {
+ public static function provideBug32548() {
return array(
array(
// This one gets interpreted all together by the prior code;
$this->assertEquals( $expectedParams, $params, $msg );
}
- function provideNormaliseParams() {
+ public static function provideNormaliseParams() {
return array(
/* Regular resize operations */
array(
$this->assertEquals( $expected, $result );
}
- function provideBitmapExtractPreRotationDimensions() {
+ public static function provideBitmapExtractPreRotationDimensions() {
return array(
array(
0,
return array( 'gallery', 'display map' /* Used by Maps, see r80025 CR */, '/foo' );
}
- function provideCases() {
+ public static function provideCases() {
return array(
array( "Foo", "<root>Foo</root>" ),
array( "<!-- Foo -->", "<root><comment><!-- Foo --></comment></root>" ),
/**
* These are more complex test cases taken out of wiki articles.
*/
- function provideFiles() {
+ public static function provideFiles() {
return array(
array( "QuoteQuran" ), # http://en.wikipedia.org/w/index.php?title=Template:QuoteQuran/sandbox&oldid=237348988 GFDL + CC-BY-SA by Striver
array( "Factorial" ), # http://en.wikipedia.org/w/index.php?title=Template:Factorial&oldid=98548758 GFDL + CC-BY-SA by Polonium
/**
* Tests from Bug 28642 · https://bugzilla.wikimedia.org/28642
*/
- function provideHeadings() {
+ public static function provideHeadings() {
return array( /* These should become headings: */
array( "== h ==<!--c1-->", "<root><h level=\"2\" i=\"1\">== h ==<comment><!--c1--></comment></h></root>" ),
array( "== h == <!--c1-->", "<root><h level=\"2\" i=\"1\">== h == <comment><!--c1--></comment></h></root>" ),
$this->assertEquals( $expected, $site->getFileUrl( $pathArgument ) );
}
- public function provideGetPageUrl() {
+ public static function provideGetPageUrl() {
return array(
// path, page, expected substring
array( 'http://acme.test/wiki/$1', 'Berlin', '/wiki/Berlin' ),
$this->assertEquals( '', $site->getProtocol() );
}
- public function provideGetPageUrl() {
+ public static function provideGetPageUrl() {
//NOTE: the assumption that the URL is built by replacing $1
// with the urlencoded version of $page
// is true for Site but not guaranteed for subclasses.
}
- function provideSearchOptionsTests() {
+ public static function provideSearchOptionsTests() {
$defaultNS = SearchEngine::defaultNamespaces();
$EMPTY_REQUEST = array();
$NO_USER_PREF = null;
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'one', 0 ),
array( 'one', 1 ),
$this->assertEquals( $expected, $this->getLang()->sprintfDate( $format, $date ) );
}
- function providerSprintfDate() {
+ public static function providerSprintfDate() {
return array(
array(
'xg "vs" g',
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'zero', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'one', 1 ),
array( 'many', 11 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'one', 1 ),
array( 'many', 11 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providePluralTwoForms() {
+ public static function providePluralTwoForms() {
return array(
array( 'one', 1 ),
array( 'other', 11 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'one', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'many', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'zero', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'one', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providerPlural() {
+ public static function providerPlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providerPluralExplicit() {
+ public static function providerPluralExplicit() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'Form 4', 0 ),
array( 'Form 2', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
// The comments in the beginning of the line help avoid RTL problems
// with text editors.
- function provideGrammar() {
+ public static function provideGrammar() {
return array (
array(
/* result */ 'וויקיפדיה',
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'one', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'many', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'zero', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'one', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providePluralTwoForms() {
+ public static function providePluralTwoForms() {
return array (
array( 'one', 1 ),
array( 'other', 2 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'zero', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array(
array( 'one', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->formatNum( $value ) );
}
- function providerFormatNum() {
+ public static function providerFormatNum() {
return array(
array( '12,34,567', '1234567' ),
array( '12,345', '12345' ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'few', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'few', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providerPluralTwoForms() {
+ public static function providerPluralTwoForms() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'one', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'many', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providerPluralTwoForms() {
+ public static function providerPluralTwoForms() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'few', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'one', 1 ),
array( 'many', 11 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providePluralTwoForms() {
+ public static function providePluralTwoForms() {
return array(
array( 'one', 1 ),
array( 'other', 11 ),
$this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
}
- function providerGrammar() {
+ public static function providerGrammar() {
return array(
array(
'Википедии',
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providerPluralTwoForms() {
+ public static function providerPluralTwoForms() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePluralAllForms() {
+ public static function providePluralAllForms() {
return array(
array( 'few', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providePluralTwoForms() {
+ public static function providePluralTwoForms() {
return array(
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'many', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providerPlural() {
+ public static function providerPlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providerPluralTwoForms() {
+ public static function providerPluralTwoForms() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'one', 1 ),
array( 'many', 11 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providePluralTwoForms() {
+ public static function providePluralTwoForms() {
return array(
array( 'one', 1 ),
array( 'other', 11 ),
$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' ),
);
}
- function provideKnownLanguageTags() {
+ public static function provideKnownLanguageTags() {
return array(
array( 'fr', 'simple code' ),
array( 'bat-smg', 'an MW legacy tag' ),
);
}
- function provideUnknownLanguageTags() {
+ public static function provideUnknownLanguageTags() {
return array(
array( 'mw', 'non-existent two-letter code' ),
);
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,
);
}
- function provideFormatDuration() {
+ public static function provideFormatDuration() {
return array(
array(
0,
);
}
- function provideCheckTitleEncodingData() {
+ public static function provideCheckTitleEncodingData() {
return array(
array( "" ),
array( "United States of America" ), // 7bit ASCII
);
}
- function provideRomanNumeralsData() {
+ public static function provideRomanNumeralsData() {
return array(
array( 1, 'I' ),
array( 2, 'II' ),
$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(
$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' ),
$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' ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'one', 0 ),
array( 'one', 1 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'one', 0 ),
array( 'one', 1 ),
$this->assertEquals( $expected, $res, $msg );
}
- function provideDottedAndDotlessI() {
+ public static function provideDottedAndDotlessI() {
return array(
# function, input, input case, expected
# Case changed:
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'one', 1 ),
array( 'many', 11 ),
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
- function providePluralTwoForms() {
+ public static function providePluralTwoForms() {
return array(
array( 'one', 1 ),
array( 'other', 11 ),
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
}
- function providePlural() {
+ public static function providePlural() {
return array (
array( 'one', 0 ),
array( 'one', 1 ),