From b36d883017982f9642fea4513cc7273561fba38c Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 22 Mar 2013 03:12:37 +0100 Subject: [PATCH] Tests: Make phpunit providers "public static". Follows-up I9d2b148e57 (including phpunit/languages this time). Bug: 46434 Change-Id: I30e5efcd88c516121c454676bd7a18f9b7c8fca6 --- .../includes/GlobalFunctions/GlobalTest.php | 6 ++-- .../GlobalFunctions/GlobalWithDBTest.php | 2 +- .../includes/GlobalFunctions/wfBCP47Test.php | 2 +- .../GlobalFunctions/wfBaseNameTest.php | 2 +- .../wfShorthandToIntegerTest.php | 2 +- .../GlobalFunctions/wfTimestampTest.php | 6 ++-- tests/phpunit/includes/HtmlTest.php | 2 +- tests/phpunit/includes/LinkerTest.php | 2 +- tests/phpunit/includes/SanitizerTest.php | 6 ++-- tests/phpunit/includes/StringUtilsTest.php | 2 +- tests/phpunit/includes/TitleTest.php | 6 ++-- tests/phpunit/includes/api/ApiBlockTest.php | 2 +- .../phpunit/includes/api/ApiEditPageTest.php | 2 +- .../includes/cache/MessageCacheTest.php | 4 +-- .../includes/filebackend/FileBackendTest.php | 22 ++++++------ .../installer/InstallDocFormatterTest.php | 2 +- .../includes/jobqueue/JobQueueTest.php | 4 +-- .../includes/json/ServicesJsonTest.php | 4 +-- tests/phpunit/includes/libs/CSSJanusTest.php | 6 ++-- tests/phpunit/includes/libs/CSSMinTest.php | 6 ++-- .../includes/libs/JavaScriptMinifierTest.php | 4 +-- .../includes/media/BitmapScalingTest.php | 2 +- .../includes/media/ExifRotationTest.php | 2 +- .../includes/parser/PreprocessorTest.php | 6 ++-- .../includes/site/MediaWikiSiteTest.php | 2 +- tests/phpunit/includes/site/SiteTest.php | 2 +- .../includes/specials/SpecialSearchTest.php | 2 +- tests/phpunit/languages/LanguageAmTest.php | 2 +- tests/phpunit/languages/LanguageArTest.php | 4 +-- tests/phpunit/languages/LanguageBeTest.php | 2 +- .../languages/LanguageBe_taraskTest.php | 4 +-- tests/phpunit/languages/LanguageBhoTest.php | 2 +- tests/phpunit/languages/LanguageBsTest.php | 2 +- tests/phpunit/languages/LanguageCsTest.php | 2 +- tests/phpunit/languages/LanguageCuTest.php | 2 +- tests/phpunit/languages/LanguageCyTest.php | 2 +- tests/phpunit/languages/LanguageDsbTest.php | 2 +- tests/phpunit/languages/LanguageFrTest.php | 2 +- tests/phpunit/languages/LanguageGaTest.php | 2 +- tests/phpunit/languages/LanguageGdTest.php | 4 +-- tests/phpunit/languages/LanguageGvTest.php | 2 +- tests/phpunit/languages/LanguageHeTest.php | 4 +-- tests/phpunit/languages/LanguageHiTest.php | 2 +- tests/phpunit/languages/LanguageHrTest.php | 2 +- tests/phpunit/languages/LanguageHsbTest.php | 2 +- tests/phpunit/languages/LanguageHuTest.php | 2 +- tests/phpunit/languages/LanguageHyTest.php | 2 +- tests/phpunit/languages/LanguageKshTest.php | 2 +- tests/phpunit/languages/LanguageLnTest.php | 2 +- tests/phpunit/languages/LanguageLtTest.php | 4 +-- tests/phpunit/languages/LanguageLvTest.php | 2 +- tests/phpunit/languages/LanguageMgTest.php | 2 +- tests/phpunit/languages/LanguageMkTest.php | 2 +- tests/phpunit/languages/LanguageMlTest.php | 2 +- tests/phpunit/languages/LanguageMoTest.php | 2 +- tests/phpunit/languages/LanguageMtTest.php | 4 +-- tests/phpunit/languages/LanguageNsoTest.php | 2 +- tests/phpunit/languages/LanguagePlTest.php | 4 +-- tests/phpunit/languages/LanguageRoTest.php | 2 +- tests/phpunit/languages/LanguageRuTest.php | 6 ++-- tests/phpunit/languages/LanguageSeTest.php | 4 +-- tests/phpunit/languages/LanguageSgsTest.php | 4 +-- tests/phpunit/languages/LanguageShTest.php | 2 +- tests/phpunit/languages/LanguageSkTest.php | 2 +- tests/phpunit/languages/LanguageSlTest.php | 2 +- tests/phpunit/languages/LanguageSmaTest.php | 4 +-- tests/phpunit/languages/LanguageSrTest.php | 4 +-- tests/phpunit/languages/LanguageTest.php | 34 +++++++++---------- tests/phpunit/languages/LanguageTiTest.php | 2 +- tests/phpunit/languages/LanguageTlTest.php | 2 +- tests/phpunit/languages/LanguageTrTest.php | 2 +- tests/phpunit/languages/LanguageUkTest.php | 4 +-- tests/phpunit/languages/LanguageWaTest.php | 2 +- 73 files changed, 131 insertions(+), 131 deletions(-) diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index 24fc47cf84..2e6417f22c 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -570,7 +570,7 @@ class GlobalTest extends MediaWikiTestCase { $this->assertEquals( $expected, $index, "wfMakeUrlIndexes(\"$url\")" ); } - function provideMakeUrlIndexes() { + public static function provideMakeUrlIndexes() { return array( array( // just a regular :) @@ -627,7 +627,7 @@ class GlobalTest extends MediaWikiTestCase { $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 ) { @@ -658,7 +658,7 @@ class GlobalTest extends MediaWikiTestCase { $this->assertEquals( $expected, $actual, $description ); } - function provideWfShellMaintenanceCmdList() { + public static function provideWfShellMaintenanceCmdList() { global $wgPhpCli; return array( array( 'eval.php', array( '--help', '--test' ), array(), diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php index 4879a38d72..c585726454 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php @@ -11,7 +11,7 @@ class GlobalWithDBTest extends MediaWikiTestCase { $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, diff --git a/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php b/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php index 8df038dd72..6229be3452 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php +++ b/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php @@ -28,7 +28,7 @@ class WfBCP47Test extends MediaWikiTestCase { /** * Array format is ($code, $expected) */ - function provideLanguageCodes() { + public static function provideLanguageCodes() { return array( // Extracted from BCP47 (list not exhaustive) # 2.1.1 diff --git a/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php b/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php index 407be8d257..3c4fa20007 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php @@ -11,7 +11,7 @@ class WfBaseNameTest extends MediaWikiTestCase { "wfBaseName('$fullpath') => '$basename'" ); } - function providePaths() { + public static function providePaths() { return array( array( '', '' ), array( '/', '' ), diff --git a/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php b/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php index 9d66d6b96f..e4e33d1ca0 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php @@ -12,7 +12,7 @@ class WfShorthandToIntegerTest extends MediaWikiTestCase { ); } - function provideABunchOfShorthands() { + public static function provideABunchOfShorthands() { return array( array( '', -1, 'Empty string' ), array( ' ', -1, 'String of spaces' ), diff --git a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php index cf1830f54b..ddfffe8232 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php @@ -10,7 +10,7 @@ class WfTimestampTest extends MediaWikiTestCase { $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 @@ -60,7 +60,7 @@ class WfTimestampTest extends MediaWikiTestCase { $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' ), @@ -99,7 +99,7 @@ class WfTimestampTest extends MediaWikiTestCase { $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' ), diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php index 590664e89b..0af7a2728d 100644 --- a/tests/phpunit/includes/HtmlTest.php +++ b/tests/phpunit/includes/HtmlTest.php @@ -418,7 +418,7 @@ class HtmlTest extends MediaWikiTestCase { * 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', diff --git a/tests/phpunit/includes/LinkerTest.php b/tests/phpunit/includes/LinkerTest.php index e353c46caf..ec4d98ec4f 100644 --- a/tests/phpunit/includes/LinkerTest.php +++ b/tests/phpunit/includes/LinkerTest.php @@ -17,7 +17,7 @@ class LinkerTest extends MediaWikiLangTestCase { ); } - function provideCasesForUserLink() { + public static function provideCasesForUserLink() { # Format: # - expected # - userid diff --git a/tests/phpunit/includes/SanitizerTest.php b/tests/phpunit/includes/SanitizerTest.php index c0ed4a5951..f5aacabe8e 100644 --- a/tests/phpunit/includes/SanitizerTest.php +++ b/tests/phpunit/includes/SanitizerTest.php @@ -90,7 +90,7 @@ class SanitizerTest extends MediaWikiTestCase { /** * 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( @@ -125,7 +125,7 @@ class SanitizerTest extends MediaWikiTestCase { ); } - function provideTagAttributesToDecode() { + public static function provideTagAttributesToDecode() { return array( array( array( 'foo' => 'bar' ), 'foo=bar', 'Unquoted attribute' ), array( array( 'foo' => 'bar' ), ' foo = bar ', 'Spaced attribute' ), @@ -229,7 +229,7 @@ class SanitizerTest extends MediaWikiTestCase { /** * Test for support or lack of support for specific attributes in the attribute whitelist. */ - function provideAttributeSupport() { + public static function provideAttributeSupport() { /** array( , , ) */ return array( array( 'div', ' role="presentation"', ' role="presentation"', 'Support for WAI-ARIA\'s role="presentation".' ), diff --git a/tests/phpunit/includes/StringUtilsTest.php b/tests/phpunit/includes/StringUtilsTest.php index db3d265520..a54a57e509 100644 --- a/tests/phpunit/includes/StringUtilsTest.php +++ b/tests/phpunit/includes/StringUtilsTest.php @@ -57,7 +57,7 @@ class StringUtilsTest extends MediaWikiTestCase { * 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; diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php index a9067852f6..cff8a2fe6e 100644 --- a/tests/phpunit/includes/TitleTest.php +++ b/tests/phpunit/includes/TitleTest.php @@ -230,7 +230,7 @@ class TitleTest extends MediaWikiTestCase { ); } - function provideCasesForGetpageviewlanguage() { + public static function provideCasesForGetpageviewlanguage() { # Format: # - expected # - Title name @@ -280,7 +280,7 @@ class TitleTest extends MediaWikiTestCase { ); } - function provideBaseTitleCases() { + public static function provideBaseTitleCases() { return array( # Title, expected base, optional message array( 'User:John_Doe/subOne/subTwo', 'John Doe/subOne' ), @@ -319,7 +319,7 @@ class TitleTest extends MediaWikiTestCase { ); } - function provideSubpageTitleCases() { + public static function provideSubpageTitleCases() { return array( # Title, expected base, optional message array( 'User:John_Doe/subOne/subTwo', 'subTwo' ), diff --git a/tests/phpunit/includes/api/ApiBlockTest.php b/tests/phpunit/includes/api/ApiBlockTest.php index 8f6b9352f2..88427665d0 100644 --- a/tests/phpunit/includes/api/ApiBlockTest.php +++ b/tests/phpunit/includes/api/ApiBlockTest.php @@ -109,7 +109,7 @@ class ApiBlockTest extends ApiTestCase { /** * Just provide the 'block' and 'unblock' action to test both API calls */ - function provideBlockUnblockAction() { + public static function provideBlockUnblockAction() { return array( array( 'block' ), array( 'unblock' ), diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php index 1efbaeafe3..06f93d7c2e 100644 --- a/tests/phpunit/includes/api/ApiEditPageTest.php +++ b/tests/phpunit/includes/api/ApiEditPageTest.php @@ -124,7 +124,7 @@ class ApiEditPageTest extends ApiTestCase { $this->assertEquals( $data, $page->getContent()->serialize() ); } - static function provideEditAppend() { + public static function provideEditAppend() { return array( array( #0: append 'foo', 'append', 'bar', "foobar" diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php index 4cc8bd2dad..eda06d4edd 100644 --- a/tests/phpunit/includes/cache/MessageCacheTest.php +++ b/tests/phpunit/includes/cache/MessageCacheTest.php @@ -63,7 +63,7 @@ class MessageCacheTest extends MediaWikiLangTestCase { $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' ), @@ -83,7 +83,7 @@ class MessageCacheTest extends MediaWikiLangTestCase { $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' ), diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php index 9fbf7bb0a4..cacaaa3474 100644 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendTest.php @@ -88,7 +88,7 @@ class FileBackendTest extends MediaWikiTestCase { "FileBackend::isStoragePath on path '$path'" ); } - function provider_testIsStoragePath() { + public static function provider_testIsStoragePath() { return array( array( 'mwstore://', true ), array( 'mwstore://backend', true ), @@ -112,7 +112,7 @@ class FileBackendTest extends MediaWikiTestCase { "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', '' ) ), @@ -136,7 +136,7 @@ class FileBackendTest extends MediaWikiTestCase { "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' ), @@ -162,7 +162,7 @@ class FileBackendTest extends MediaWikiTestCase { "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' ), @@ -927,7 +927,7 @@ class FileBackendTest extends MediaWikiTestCase { } } - function provider_testConcatenate() { + public static function provider_testConcatenate() { $cases = array(); $rand = mt_rand( 0, 2000000000 ) . time(); @@ -1041,7 +1041,7 @@ class FileBackendTest extends MediaWikiTestCase { } } - function provider_testGetFileStat() { + public static function provider_testGetFileStat() { $cases = array(); $base = self::baseStorePath(); @@ -1096,7 +1096,7 @@ class FileBackendTest extends MediaWikiTestCase { } } - function provider_testGetFileContents() { + public static function provider_testGetFileContents() { $cases = array(); $base = self::baseStorePath(); @@ -1164,7 +1164,7 @@ class FileBackendTest extends MediaWikiTestCase { $tmpFile->bind( $obj ); } - function provider_testGetLocalCopy() { + public static function provider_testGetLocalCopy() { $cases = array(); $base = self::baseStorePath(); @@ -1230,7 +1230,7 @@ class FileBackendTest extends MediaWikiTestCase { } } - function provider_testGetLocalReference() { + public static function provider_testGetLocalReference() { $cases = array(); $base = self::baseStorePath(); @@ -1305,7 +1305,7 @@ class FileBackendTest extends MediaWikiTestCase { } } - function provider_testGetFileHttpUrl() { + public static function provider_testGetFileHttpUrl() { $cases = array(); $base = self::baseStorePath(); @@ -1329,7 +1329,7 @@ class FileBackendTest extends MediaWikiTestCase { $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 ), diff --git a/tests/phpunit/includes/installer/InstallDocFormatterTest.php b/tests/phpunit/includes/installer/InstallDocFormatterTest.php index 74b921a58e..2642541eb6 100644 --- a/tests/phpunit/includes/installer/InstallDocFormatterTest.php +++ b/tests/phpunit/includes/installer/InstallDocFormatterTest.php @@ -20,7 +20,7 @@ class InstallDocFormatterTest extends MediaWikiTestCase { /** * Provider for testFormat() */ - function provideDocFormattingTests() { + public static function provideDocFormattingTests() { # Format: (expected string, unformattedText string, optional message) return array( # Escape some wikitext diff --git a/tests/phpunit/includes/jobqueue/JobQueueTest.php b/tests/phpunit/includes/jobqueue/JobQueueTest.php index f3f9c11e12..a4ab15c5d8 100644 --- a/tests/phpunit/includes/jobqueue/JobQueueTest.php +++ b/tests/phpunit/includes/jobqueue/JobQueueTest.php @@ -288,7 +288,7 @@ class JobQueueTest extends MediaWikiTestCase { $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()' ), @@ -299,7 +299,7 @@ class JobQueueTest extends MediaWikiTestCase { ); } - function provider_fifoQueueLists() { + public static function provider_fifoQueueLists() { return array( array( 'queueFifo', false, 'Ordered queue without ack()' ), array( 'queueFifoTTL', true, 'Ordered queue with ack()' ) diff --git a/tests/phpunit/includes/json/ServicesJsonTest.php b/tests/phpunit/includes/json/ServicesJsonTest.php index 56dc648802..5051830381 100644 --- a/tests/phpunit/includes/json/ServicesJsonTest.php +++ b/tests/phpunit/includes/json/ServicesJsonTest.php @@ -47,7 +47,7 @@ class ServicesJsonTest extends MediaWikiTestCase { } } - function provideValuesToEncode() { + public static function provideValuesToEncode() { $obj = new stdClass(); $obj->property = 'value'; $obj->property2 = null; @@ -71,7 +71,7 @@ class ServicesJsonTest extends MediaWikiTestCase { ); } - function provideValuesToDecode() { + public static function provideValuesToDecode() { return array( array( '1', 'basic integer' ), array( '-1', 'negative integer' ), diff --git a/tests/phpunit/includes/libs/CSSJanusTest.php b/tests/phpunit/includes/libs/CSSJanusTest.php index 26747b91f9..632eb52c3e 100644 --- a/tests/phpunit/includes/libs/CSSJanusTest.php +++ b/tests/phpunit/includes/libs/CSSJanusTest.php @@ -54,7 +54,7 @@ class CSSJanusTest extends MediaWikiTestCase { * 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( @@ -476,7 +476,7 @@ class CSSJanusTest extends MediaWikiTestCase { * 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', @@ -542,7 +542,7 @@ class CSSJanusTest extends MediaWikiTestCase { * 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( diff --git a/tests/phpunit/includes/libs/CSSMinTest.php b/tests/phpunit/includes/libs/CSSMinTest.php index 57017a84ea..e9901ce24d 100644 --- a/tests/phpunit/includes/libs/CSSMinTest.php +++ b/tests/phpunit/includes/libs/CSSMinTest.php @@ -27,7 +27,7 @@ class CSSMinTest extends MediaWikiTestCase { $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", "" ), @@ -77,7 +77,7 @@ class CSSMinTest extends MediaWikiTestCase { $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( @@ -119,7 +119,7 @@ class CSSMinTest extends MediaWikiTestCase { $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 diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php index 1f55079504..eb64a6446b 100644 --- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php +++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php @@ -2,7 +2,7 @@ class JavaScriptMinifierTest extends MediaWikiTestCase { - function provideCases() { + public static function provideCases() { return array( // Basic whitespace and comments that should be stripped entirely @@ -132,7 +132,7 @@ class JavaScriptMinifierTest extends MediaWikiTestCase { $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; diff --git a/tests/phpunit/includes/media/BitmapScalingTest.php b/tests/phpunit/includes/media/BitmapScalingTest.php index 3de60b7306..c4706bf644 100644 --- a/tests/phpunit/includes/media/BitmapScalingTest.php +++ b/tests/phpunit/includes/media/BitmapScalingTest.php @@ -22,7 +22,7 @@ class BitmapScalingTest extends MediaWikiTestCase { $this->assertEquals( $expectedParams, $params, $msg ); } - function provideNormaliseParams() { + public static function provideNormaliseParams() { return array( /* Regular resize operations */ array( diff --git a/tests/phpunit/includes/media/ExifRotationTest.php b/tests/phpunit/includes/media/ExifRotationTest.php index db29d17c0c..075e12ea1a 100644 --- a/tests/phpunit/includes/media/ExifRotationTest.php +++ b/tests/phpunit/includes/media/ExifRotationTest.php @@ -238,7 +238,7 @@ class ExifRotationTest extends MediaWikiTestCase { $this->assertEquals( $expected, $result ); } - function provideBitmapExtractPreRotationDimensions() { + public static function provideBitmapExtractPreRotationDimensions() { return array( array( 0, diff --git a/tests/phpunit/includes/parser/PreprocessorTest.php b/tests/phpunit/includes/parser/PreprocessorTest.php index c51a1dc599..fb13118091 100644 --- a/tests/phpunit/includes/parser/PreprocessorTest.php +++ b/tests/phpunit/includes/parser/PreprocessorTest.php @@ -18,7 +18,7 @@ class PreprocessorTest extends MediaWikiTestCase { return array( 'gallery', 'display map' /* Used by Maps, see r80025 CR */, '/foo' ); } - function provideCases() { + public static function provideCases() { return array( array( "Foo", "Foo" ), array( "", "<!-- Foo -->" ), @@ -148,7 +148,7 @@ class PreprocessorTest extends MediaWikiTestCase { /** * 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 @@ -180,7 +180,7 @@ class PreprocessorTest extends MediaWikiTestCase { /** * Tests from Bug 28642 · https://bugzilla.wikimedia.org/28642 */ - function provideHeadings() { + public static function provideHeadings() { return array( /* These should become headings: */ array( "== h ==", "== h ==<!--c1-->" ), array( "== h == ", "== h == <!--c1-->" ), diff --git a/tests/phpunit/includes/site/MediaWikiSiteTest.php b/tests/phpunit/includes/site/MediaWikiSiteTest.php index 0cecdeeac6..b86636f1c1 100644 --- a/tests/phpunit/includes/site/MediaWikiSiteTest.php +++ b/tests/phpunit/includes/site/MediaWikiSiteTest.php @@ -62,7 +62,7 @@ class MediaWikiSiteTest extends SiteTest { $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' ), diff --git a/tests/phpunit/includes/site/SiteTest.php b/tests/phpunit/includes/site/SiteTest.php index d20e2a5244..80337847d2 100644 --- a/tests/phpunit/includes/site/SiteTest.php +++ b/tests/phpunit/includes/site/SiteTest.php @@ -201,7 +201,7 @@ class SiteTest extends MediaWikiTestCase { $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. diff --git a/tests/phpunit/includes/specials/SpecialSearchTest.php b/tests/phpunit/includes/specials/SpecialSearchTest.php index f5ef0fb778..15a11ed308 100644 --- a/tests/phpunit/includes/specials/SpecialSearchTest.php +++ b/tests/phpunit/includes/specials/SpecialSearchTest.php @@ -56,7 +56,7 @@ class SpecialSearchTest extends MediaWikiTestCase { } - function provideSearchOptionsTests() { + public static function provideSearchOptionsTests() { $defaultNS = SearchEngine::defaultNamespaces(); $EMPTY_REQUEST = array(); $NO_USER_PREF = null; diff --git a/tests/phpunit/languages/LanguageAmTest.php b/tests/phpunit/languages/LanguageAmTest.php index ebbe5a2ca6..fdf3347b6a 100644 --- a/tests/phpunit/languages/LanguageAmTest.php +++ b/tests/phpunit/languages/LanguageAmTest.php @@ -18,7 +18,7 @@ class LanguageAmTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'one', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageArTest.php b/tests/phpunit/languages/LanguageArTest.php index fee05fcdb3..a6239120db 100644 --- a/tests/phpunit/languages/LanguageArTest.php +++ b/tests/phpunit/languages/LanguageArTest.php @@ -19,7 +19,7 @@ class LanguageArTest extends LanguageClassesTestCase { $this->assertEquals( $expected, $this->getLang()->sprintfDate( $format, $date ) ); } - function providerSprintfDate() { + public static function providerSprintfDate() { return array( array( 'xg "vs" g', @@ -55,7 +55,7 @@ class LanguageArTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'zero', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageBeTest.php b/tests/phpunit/languages/LanguageBeTest.php index 340b33424e..a88356aeab 100644 --- a/tests/phpunit/languages/LanguageBeTest.php +++ b/tests/phpunit/languages/LanguageBeTest.php @@ -18,7 +18,7 @@ class LanguageBeTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'one', 1 ), array( 'many', 11 ), diff --git a/tests/phpunit/languages/LanguageBe_taraskTest.php b/tests/phpunit/languages/LanguageBe_taraskTest.php index aa8c28a020..8bc908d04d 100644 --- a/tests/phpunit/languages/LanguageBe_taraskTest.php +++ b/tests/phpunit/languages/LanguageBe_taraskTest.php @@ -43,7 +43,7 @@ class LanguageBe_taraskTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'one', 1 ), array( 'many', 11 ), @@ -65,7 +65,7 @@ class LanguageBe_taraskTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providePluralTwoForms() { + public static function providePluralTwoForms() { return array( array( 'one', 1 ), array( 'other', 11 ), diff --git a/tests/phpunit/languages/LanguageBhoTest.php b/tests/phpunit/languages/LanguageBhoTest.php index 7384ed70a5..3cdde36d8b 100644 --- a/tests/phpunit/languages/LanguageBhoTest.php +++ b/tests/phpunit/languages/LanguageBhoTest.php @@ -18,7 +18,7 @@ class LanguageBhoTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'one', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageBsTest.php b/tests/phpunit/languages/LanguageBsTest.php index d44dc32efb..83a0ef6351 100644 --- a/tests/phpunit/languages/LanguageBsTest.php +++ b/tests/phpunit/languages/LanguageBsTest.php @@ -18,7 +18,7 @@ class LanguageBsTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'many', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageCsTest.php b/tests/phpunit/languages/LanguageCsTest.php index 9a4991b62f..06374d4999 100644 --- a/tests/phpunit/languages/LanguageCsTest.php +++ b/tests/phpunit/languages/LanguageCsTest.php @@ -18,7 +18,7 @@ class LanguageCsTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageCuTest.php b/tests/phpunit/languages/LanguageCuTest.php index 73849186f6..a368371aa6 100644 --- a/tests/phpunit/languages/LanguageCuTest.php +++ b/tests/phpunit/languages/LanguageCuTest.php @@ -18,7 +18,7 @@ class LanguageCuTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageCyTest.php b/tests/phpunit/languages/LanguageCyTest.php index d56d622c8d..221a49846f 100644 --- a/tests/phpunit/languages/LanguageCyTest.php +++ b/tests/phpunit/languages/LanguageCyTest.php @@ -18,7 +18,7 @@ class LanguageCyTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'zero', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageDsbTest.php b/tests/phpunit/languages/LanguageDsbTest.php index b3f01c3af7..be421247f7 100644 --- a/tests/phpunit/languages/LanguageDsbTest.php +++ b/tests/phpunit/languages/LanguageDsbTest.php @@ -18,7 +18,7 @@ class LanguageDsbTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageFrTest.php b/tests/phpunit/languages/LanguageFrTest.php index 2ab5d871ca..4f96b48a08 100644 --- a/tests/phpunit/languages/LanguageFrTest.php +++ b/tests/phpunit/languages/LanguageFrTest.php @@ -18,7 +18,7 @@ class LanguageFrTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'one', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageGaTest.php b/tests/phpunit/languages/LanguageGaTest.php index cac3a02b26..da7cf12f48 100644 --- a/tests/phpunit/languages/LanguageGaTest.php +++ b/tests/phpunit/languages/LanguageGaTest.php @@ -18,7 +18,7 @@ class LanguageGaTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageGdTest.php b/tests/phpunit/languages/LanguageGdTest.php index b7d5cc225f..4ff97ea871 100644 --- a/tests/phpunit/languages/LanguageGdTest.php +++ b/tests/phpunit/languages/LanguageGdTest.php @@ -13,7 +13,7 @@ class LanguageGdTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providerPlural() { + public static function providerPlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), @@ -32,7 +32,7 @@ class LanguageGdTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providerPluralExplicit() { + public static function providerPluralExplicit() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageGvTest.php b/tests/phpunit/languages/LanguageGvTest.php index 6e24aea2e8..ef95c5f39b 100644 --- a/tests/phpunit/languages/LanguageGvTest.php +++ b/tests/phpunit/languages/LanguageGvTest.php @@ -21,7 +21,7 @@ class LanguageGvTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'Form 4', 0 ), array( 'Form 2', 1 ), diff --git a/tests/phpunit/languages/LanguageHeTest.php b/tests/phpunit/languages/LanguageHeTest.php index 1335e9081d..3fbd51e935 100644 --- a/tests/phpunit/languages/LanguageHeTest.php +++ b/tests/phpunit/languages/LanguageHeTest.php @@ -18,7 +18,7 @@ class LanguageHeTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), @@ -35,7 +35,7 @@ class LanguageHeTest extends LanguageClassesTestCase { // 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 */ 'וויקיפדיה', diff --git a/tests/phpunit/languages/LanguageHiTest.php b/tests/phpunit/languages/LanguageHiTest.php index b21bfe4789..9502d6ae3f 100644 --- a/tests/phpunit/languages/LanguageHiTest.php +++ b/tests/phpunit/languages/LanguageHiTest.php @@ -18,7 +18,7 @@ class LanguageHiTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'one', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageHrTest.php b/tests/phpunit/languages/LanguageHrTest.php index 76e281bac6..badfd112ef 100644 --- a/tests/phpunit/languages/LanguageHrTest.php +++ b/tests/phpunit/languages/LanguageHrTest.php @@ -18,7 +18,7 @@ class LanguageHrTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'many', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageHsbTest.php b/tests/phpunit/languages/LanguageHsbTest.php index 8fee54940e..bae454256b 100644 --- a/tests/phpunit/languages/LanguageHsbTest.php +++ b/tests/phpunit/languages/LanguageHsbTest.php @@ -18,7 +18,7 @@ class LanguageHsbTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageHuTest.php b/tests/phpunit/languages/LanguageHuTest.php index 462a7dd3ef..40ae108760 100644 --- a/tests/phpunit/languages/LanguageHuTest.php +++ b/tests/phpunit/languages/LanguageHuTest.php @@ -18,7 +18,7 @@ class LanguageHuTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageHyTest.php b/tests/phpunit/languages/LanguageHyTest.php index 70717f1389..f520b7e764 100644 --- a/tests/phpunit/languages/LanguageHyTest.php +++ b/tests/phpunit/languages/LanguageHyTest.php @@ -19,7 +19,7 @@ class LanguageHyTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageKshTest.php b/tests/phpunit/languages/LanguageKshTest.php index 7efd58ac2d..e863490f1e 100644 --- a/tests/phpunit/languages/LanguageKshTest.php +++ b/tests/phpunit/languages/LanguageKshTest.php @@ -18,7 +18,7 @@ class LanguageKshTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'zero', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageLnTest.php b/tests/phpunit/languages/LanguageLnTest.php index 052604cf00..2fa40b5add 100644 --- a/tests/phpunit/languages/LanguageLnTest.php +++ b/tests/phpunit/languages/LanguageLnTest.php @@ -18,7 +18,7 @@ class LanguageLnTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'one', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageLtTest.php b/tests/phpunit/languages/LanguageLtTest.php index eface4cbc1..45f083be2e 100644 --- a/tests/phpunit/languages/LanguageLtTest.php +++ b/tests/phpunit/languages/LanguageLtTest.php @@ -18,7 +18,7 @@ class LanguageLtTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), @@ -41,7 +41,7 @@ class LanguageLtTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providePluralTwoForms() { + public static function providePluralTwoForms() { return array ( array( 'one', 1 ), array( 'other', 2 ), diff --git a/tests/phpunit/languages/LanguageLvTest.php b/tests/phpunit/languages/LanguageLvTest.php index dce2f7974e..3ff9589177 100644 --- a/tests/phpunit/languages/LanguageLvTest.php +++ b/tests/phpunit/languages/LanguageLvTest.php @@ -18,7 +18,7 @@ class LanguageLvTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'zero', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageMgTest.php b/tests/phpunit/languages/LanguageMgTest.php index e88b0afbf2..f4eb99ad04 100644 --- a/tests/phpunit/languages/LanguageMgTest.php +++ b/tests/phpunit/languages/LanguageMgTest.php @@ -18,7 +18,7 @@ class LanguageMgTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array( array( 'one', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageMkTest.php b/tests/phpunit/languages/LanguageMkTest.php index a5a8f6c79c..4ff2e3e81e 100644 --- a/tests/phpunit/languages/LanguageMkTest.php +++ b/tests/phpunit/languages/LanguageMkTest.php @@ -18,7 +18,7 @@ class LanguageMkTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageMlTest.php b/tests/phpunit/languages/LanguageMlTest.php index 396114d972..057ca6722a 100644 --- a/tests/phpunit/languages/LanguageMlTest.php +++ b/tests/phpunit/languages/LanguageMlTest.php @@ -14,7 +14,7 @@ class LanguageMlTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->formatNum( $value ) ); } - function providerFormatNum() { + public static function providerFormatNum() { return array( array( '12,34,567', '1234567' ), array( '12,345', '12345' ), diff --git a/tests/phpunit/languages/LanguageMoTest.php b/tests/phpunit/languages/LanguageMoTest.php index 31d183a6a4..3ffa4e773f 100644 --- a/tests/phpunit/languages/LanguageMoTest.php +++ b/tests/phpunit/languages/LanguageMoTest.php @@ -18,7 +18,7 @@ class LanguageMoTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'few', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageMtTest.php b/tests/phpunit/languages/LanguageMtTest.php index 8f5d7649bd..350aa082c9 100644 --- a/tests/phpunit/languages/LanguageMtTest.php +++ b/tests/phpunit/languages/LanguageMtTest.php @@ -18,7 +18,7 @@ class LanguageMtTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'few', 0 ), array( 'one', 1 ), @@ -45,7 +45,7 @@ class LanguageMtTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providerPluralTwoForms() { + public static function providerPluralTwoForms() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageNsoTest.php b/tests/phpunit/languages/LanguageNsoTest.php index 7a7bff2722..059de44947 100644 --- a/tests/phpunit/languages/LanguageNsoTest.php +++ b/tests/phpunit/languages/LanguageNsoTest.php @@ -18,7 +18,7 @@ class LanguageNsoTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'one', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguagePlTest.php b/tests/phpunit/languages/LanguagePlTest.php index 1ace10b8ef..837fc3a17c 100644 --- a/tests/phpunit/languages/LanguagePlTest.php +++ b/tests/phpunit/languages/LanguagePlTest.php @@ -18,7 +18,7 @@ class LanguagePlTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'many', 0 ), array( 'one', 1 ), @@ -45,7 +45,7 @@ class LanguagePlTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providerPluralTwoForms() { + public static function providerPluralTwoForms() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageRoTest.php b/tests/phpunit/languages/LanguageRoTest.php index 261d25a951..70324f59cf 100644 --- a/tests/phpunit/languages/LanguageRoTest.php +++ b/tests/phpunit/languages/LanguageRoTest.php @@ -18,7 +18,7 @@ class LanguageRoTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'few', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php index 3bdf6546bf..ccfda20aa1 100644 --- a/tests/phpunit/languages/LanguageRuTest.php +++ b/tests/phpunit/languages/LanguageRuTest.php @@ -19,7 +19,7 @@ class LanguageRuTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'one', 1 ), array( 'many', 11 ), @@ -41,7 +41,7 @@ class LanguageRuTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providePluralTwoForms() { + public static function providePluralTwoForms() { return array( array( 'one', 1 ), array( 'other', 11 ), @@ -55,7 +55,7 @@ class LanguageRuTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) ); } - function providerGrammar() { + public static function providerGrammar() { return array( array( 'Википедии', diff --git a/tests/phpunit/languages/LanguageSeTest.php b/tests/phpunit/languages/LanguageSeTest.php index 3e676b91cc..9b9297c766 100644 --- a/tests/phpunit/languages/LanguageSeTest.php +++ b/tests/phpunit/languages/LanguageSeTest.php @@ -18,7 +18,7 @@ class LanguageSeTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), @@ -33,7 +33,7 @@ class LanguageSeTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providerPluralTwoForms() { + public static function providerPluralTwoForms() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageSgsTest.php b/tests/phpunit/languages/LanguageSgsTest.php index 4721d50e39..589a369a16 100644 --- a/tests/phpunit/languages/LanguageSgsTest.php +++ b/tests/phpunit/languages/LanguageSgsTest.php @@ -18,7 +18,7 @@ class LanguageSgsTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePluralAllForms() { + public static function providePluralAllForms() { return array( array( 'few', 0 ), array( 'one', 1 ), @@ -42,7 +42,7 @@ class LanguageSgsTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providePluralTwoForms() { + public static function providePluralTwoForms() { return array( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageShTest.php b/tests/phpunit/languages/LanguageShTest.php index e59c894928..8dd18ea55e 100644 --- a/tests/phpunit/languages/LanguageShTest.php +++ b/tests/phpunit/languages/LanguageShTest.php @@ -18,7 +18,7 @@ class LanguageShTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'many', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageSkTest.php b/tests/phpunit/languages/LanguageSkTest.php index 48d253c955..da09b563b9 100644 --- a/tests/phpunit/languages/LanguageSkTest.php +++ b/tests/phpunit/languages/LanguageSkTest.php @@ -19,7 +19,7 @@ class LanguageSkTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageSlTest.php b/tests/phpunit/languages/LanguageSlTest.php index 232e35bb1c..8329791427 100644 --- a/tests/phpunit/languages/LanguageSlTest.php +++ b/tests/phpunit/languages/LanguageSlTest.php @@ -19,7 +19,7 @@ class LanguageSlTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providerPlural() { + public static function providerPlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageSmaTest.php b/tests/phpunit/languages/LanguageSmaTest.php index 3503461f3a..2eb811367c 100644 --- a/tests/phpunit/languages/LanguageSmaTest.php +++ b/tests/phpunit/languages/LanguageSmaTest.php @@ -18,7 +18,7 @@ class LanguageSmaTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'other', 0 ), array( 'one', 1 ), @@ -33,7 +33,7 @@ class LanguageSmaTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providerPluralTwoForms() { + public static function providerPluralTwoForms() { return array ( array( 'other', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageSrTest.php b/tests/phpunit/languages/LanguageSrTest.php index 7fbe13c223..05e88752f4 100644 --- a/tests/phpunit/languages/LanguageSrTest.php +++ b/tests/phpunit/languages/LanguageSrTest.php @@ -121,7 +121,7 @@ class LanguageSrTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'one', 1 ), array( 'many', 11 ), @@ -143,7 +143,7 @@ class LanguageSrTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providePluralTwoForms() { + public static function providePluralTwoForms() { return array( array( 'one', 1 ), array( 'other', 11 ), diff --git a/tests/phpunit/languages/LanguageTest.php b/tests/phpunit/languages/LanguageTest.php index 76471445a2..f55684ff51 100644 --- a/tests/phpunit/languages/LanguageTest.php +++ b/tests/phpunit/languages/LanguageTest.php @@ -19,7 +19,7 @@ class LanguageTest extends LanguageClassesTestCase { $this->assertEquals( $expected, $this->getLang()->formatTimePeriod( $seconds, $format ), $desc ); } - function provideFormattableTimes() { + public static function provideFormattableTimes() { return array( array( 9.45, @@ -251,7 +251,7 @@ class LanguageTest extends LanguageClassesTestCase { /** * 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" ), @@ -324,7 +324,7 @@ class LanguageTest extends LanguageClassesTestCase { * 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' ), @@ -375,7 +375,7 @@ class LanguageTest extends LanguageClassesTestCase { * 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' ), @@ -437,7 +437,7 @@ class LanguageTest extends LanguageClassesTestCase { ); } - function provideLanguageCodes() { + public static function provideLanguageCodes() { return array( array( 'fr', 'Two letters, minor case' ), array( 'EN', 'Two letters, upper case' ), @@ -460,7 +460,7 @@ class LanguageTest extends LanguageClassesTestCase { ); } - function provideKnownLanguageTags() { + public static function provideKnownLanguageTags() { return array( array( 'fr', 'simple code' ), array( 'bat-smg', 'an MW legacy tag' ), @@ -493,7 +493,7 @@ class LanguageTest extends LanguageClassesTestCase { ); } - function provideUnknownLanguageTags() { + public static function provideUnknownLanguageTags() { return array( array( 'mw', 'non-existent two-letter code' ), ); @@ -530,7 +530,7 @@ class LanguageTest extends LanguageClassesTestCase { date_default_timezone_set( $oldTZ ); } - function provideSprintfDateSamples() { + public static function provideSprintfDateSamples() { return array( array( 'xiY', @@ -836,7 +836,7 @@ class LanguageTest extends LanguageClassesTestCase { ); } - function provideFormatSizes() { + public static function provideFormatSizes() { return array( array( 0, @@ -898,7 +898,7 @@ class LanguageTest extends LanguageClassesTestCase { ); } - function provideFormatBitrate() { + public static function provideFormatBitrate() { return array( array( 0, @@ -970,7 +970,7 @@ class LanguageTest extends LanguageClassesTestCase { ); } - function provideFormatDuration() { + public static function provideFormatDuration() { return array( array( 0, @@ -1106,7 +1106,7 @@ class LanguageTest extends LanguageClassesTestCase { ); } - function provideCheckTitleEncodingData() { + public static function provideCheckTitleEncodingData() { return array( array( "" ), array( "United States of America" ), // 7bit ASCII @@ -1170,7 +1170,7 @@ class LanguageTest extends LanguageClassesTestCase { ); } - function provideRomanNumeralsData() { + public static function provideRomanNumeralsData() { return array( array( 1, 'I' ), array( 2, 'II' ), @@ -1225,7 +1225,7 @@ class LanguageTest extends LanguageClassesTestCase { $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( @@ -1273,7 +1273,7 @@ class LanguageTest extends LanguageClassesTestCase { $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' ), @@ -1302,7 +1302,7 @@ class LanguageTest extends LanguageClassesTestCase { ); } - function provideCommafyData() { + public static function provideCommafyData() { return array( array( 1, '1' ), array( 10, '10' ), @@ -1341,7 +1341,7 @@ class LanguageTest extends LanguageClassesTestCase { $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' ), diff --git a/tests/phpunit/languages/LanguageTiTest.php b/tests/phpunit/languages/LanguageTiTest.php index 4a86086469..b2cc4c3366 100644 --- a/tests/phpunit/languages/LanguageTiTest.php +++ b/tests/phpunit/languages/LanguageTiTest.php @@ -18,7 +18,7 @@ class LanguageTiTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'one', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageTlTest.php b/tests/phpunit/languages/LanguageTlTest.php index 383fe6ca2d..0299653925 100644 --- a/tests/phpunit/languages/LanguageTlTest.php +++ b/tests/phpunit/languages/LanguageTlTest.php @@ -18,7 +18,7 @@ class LanguageTlTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'one', 0 ), array( 'one', 1 ), diff --git a/tests/phpunit/languages/LanguageTrTest.php b/tests/phpunit/languages/LanguageTrTest.php index e93d49d967..464a310cf3 100644 --- a/tests/phpunit/languages/LanguageTrTest.php +++ b/tests/phpunit/languages/LanguageTrTest.php @@ -31,7 +31,7 @@ class LanguageTrTest extends LanguageClassesTestCase { $this->assertEquals( $expected, $res, $msg ); } - function provideDottedAndDotlessI() { + public static function provideDottedAndDotlessI() { return array( # function, input, input case, expected # Case changed: diff --git a/tests/phpunit/languages/LanguageUkTest.php b/tests/phpunit/languages/LanguageUkTest.php index f7f736943f..66cd1834b2 100644 --- a/tests/phpunit/languages/LanguageUkTest.php +++ b/tests/phpunit/languages/LanguageUkTest.php @@ -19,7 +19,7 @@ class LanguageUkTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'one', 1 ), array( 'many', 11 ), @@ -41,7 +41,7 @@ class LanguageUkTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providePluralTwoForms() { + public static function providePluralTwoForms() { return array( array( 'one', 1 ), array( 'other', 11 ), diff --git a/tests/phpunit/languages/LanguageWaTest.php b/tests/phpunit/languages/LanguageWaTest.php index b4c92b7139..813222d364 100644 --- a/tests/phpunit/languages/LanguageWaTest.php +++ b/tests/phpunit/languages/LanguageWaTest.php @@ -18,7 +18,7 @@ class LanguageWaTest extends LanguageClassesTestCase { $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { + public static function providePlural() { return array ( array( 'one', 0 ), array( 'one', 1 ), -- 2.20.1