From de7af7ac2c651d747221dd322fa9e40956681cb9 Mon Sep 17 00:00:00 2001 From: addshore Date: Wed, 23 Oct 2013 23:51:31 +0100 Subject: [PATCH] Fix scope on all /phpunit test methods Change-Id: I3ce92463d485a0fb23e464e9a8059330f32d79af --- tests/phpunit/includes/ArticleTablesTest.php | 2 +- tests/phpunit/includes/ArticleTest.php | 12 +++--- tests/phpunit/includes/BlockTest.php | 14 +++---- tests/phpunit/includes/CollationTest.php | 6 +-- .../phpunit/includes/DiffHistoryBlobTest.php | 2 +- tests/phpunit/includes/EditPageTest.php | 2 +- tests/phpunit/includes/ExternalStoreTest.php | 2 +- tests/phpunit/includes/ExtraParserTest.php | 24 +++++------ tests/phpunit/includes/FauxRequestTest.php | 2 +- tests/phpunit/includes/FauxResponseTest.php | 6 +-- .../includes/GlobalFunctions/GlobalTest.php | 42 +++++++++---------- .../GlobalFunctions/GlobalWithDBTest.php | 2 +- .../includes/GlobalFunctions/wfBCP47Test.php | 2 +- .../GlobalFunctions/wfBaseNameTest.php | 2 +- .../GlobalFunctions/wfGetCallerTest.php | 8 ++-- .../wfShorthandToIntegerTest.php | 2 +- .../GlobalFunctions/wfTimestampTest.php | 8 ++-- tests/phpunit/includes/HashRingTest.php | 2 +- tests/phpunit/includes/HtmlTest.php | 14 +++---- tests/phpunit/includes/HttpTest.php | 2 +- tests/phpunit/includes/IPTest.php | 10 ++--- .../includes/LanguageConverterTest.php | 20 ++++----- tests/phpunit/includes/LicensesTest.php | 2 +- tests/phpunit/includes/LinkerTest.php | 2 +- tests/phpunit/includes/LocalFileTest.php | 22 +++++----- tests/phpunit/includes/MWFunctionTest.php | 2 +- tests/phpunit/includes/MessageTest.php | 20 ++++----- tests/phpunit/includes/SampleTest.php | 4 +- tests/phpunit/includes/StringUtilsTest.php | 4 +- .../includes/TemplateCategoriesTest.php | 2 +- tests/phpunit/includes/WebRequestTest.php | 8 ++-- tests/phpunit/includes/XmlTest.php | 42 +++++++++---------- .../includes/ZipDirectoryReaderTest.php | 20 ++++----- .../includes/api/ApiAccountCreationTest.php | 10 ++--- tests/phpunit/includes/api/ApiBlockTest.php | 4 +- .../phpunit/includes/api/ApiEditPageTest.php | 16 +++---- tests/phpunit/includes/api/ApiParseTest.php | 2 +- tests/phpunit/includes/api/ApiPurgeTest.php | 2 +- tests/phpunit/includes/api/ApiTest.php | 20 ++++----- tests/phpunit/includes/api/ApiUploadTest.php | 2 +- tests/phpunit/includes/api/ApiWatchTest.php | 10 ++--- .../includes/api/format/ApiFormatPhpTest.php | 2 +- .../api/query/ApiQueryRevisionsTest.php | 2 +- .../includes/api/query/ApiQueryTest.php | 4 +- .../includes/cache/GenderCacheTest.php | 6 +-- .../includes/cache/MessageCacheTest.php | 4 +- .../includes/cache/ProcessCacheLRUTest.php | 18 ++++---- .../includes/db/DatabaseMysqlBaseTest.php | 2 +- tests/phpunit/includes/db/DatabaseSQLTest.php | 34 +++++++-------- .../includes/db/DatabaseSqliteTest.php | 2 +- tests/phpunit/includes/db/DatabaseTest.php | 34 +++++++-------- tests/phpunit/includes/debug/MWDebugTest.php | 8 ++-- .../includes/filerepo/FileRepoTest.php | 10 ++--- .../installer/InstallDocFormatterTest.php | 2 +- .../installer/OracleInstallerTest.php | 2 +- .../includes/jobqueue/JobQueueTest.php | 10 ++--- tests/phpunit/includes/libs/CSSMinTest.php | 6 +-- .../includes/libs/IEUrlExtensionTest.php | 30 ++++++------- .../includes/libs/JavaScriptMinifierTest.php | 4 +- tests/phpunit/includes/normal/CleanUpTest.php | 28 ++++++------- .../phpunit/includes/parser/NewParserTest.php | 2 +- .../includes/parser/PreprocessorTest.php | 2 +- .../phpunit/includes/parser/TagHooksTest.php | 8 ++-- .../includes/search/SearchEngineTest.php | 10 ++--- .../includes/search/SearchUpdateTest.php | 4 +- .../specials/QueryAllSpecialPagesTest.php | 2 +- .../specials/SpecialPreferencesTest.php | 2 +- .../includes/specials/SpecialSearchTest.php | 4 +- 68 files changed, 311 insertions(+), 311 deletions(-) diff --git a/tests/phpunit/includes/ArticleTablesTest.php b/tests/phpunit/includes/ArticleTablesTest.php index 686ab93974..0f159ae42b 100644 --- a/tests/phpunit/includes/ArticleTablesTest.php +++ b/tests/phpunit/includes/ArticleTablesTest.php @@ -5,7 +5,7 @@ */ class ArticleTablesTest extends MediaWikiLangTestCase { - function testbug14404() { + public function testbug14404() { global $wgContLang, $wgLanguageCode, $wgLang; $title = Title::newFromText( 'Bug 14404' ); diff --git a/tests/phpunit/includes/ArticleTest.php b/tests/phpunit/includes/ArticleTest.php index 867c4f007b..b4d6dca6d4 100644 --- a/tests/phpunit/includes/ArticleTest.php +++ b/tests/phpunit/includes/ArticleTest.php @@ -25,14 +25,14 @@ class ArticleTest extends MediaWikiTestCase { $this->article = null; } - function testImplementsGetMagic() { + public function testImplementsGetMagic() { $this->assertEquals( false, $this->article->mLatest, "Article __get magic" ); } /** * @depends testImplementsGetMagic */ - function testImplementsSetMagic() { + public function testImplementsSetMagic() { $this->article->mLatest = 2; $this->assertEquals( 2, $this->article->mLatest, "Article __set magic" ); } @@ -40,13 +40,13 @@ class ArticleTest extends MediaWikiTestCase { /** * @depends testImplementsSetMagic */ - function testImplementsCallMagic() { + public function testImplementsCallMagic() { $this->article->mLatest = 33; $this->article->mDataLoaded = true; $this->assertEquals( 33, $this->article->getLatest(), "Article __call magic" ); } - function testGetOrSetOnNewProperty() { + public function testGetOrSetOnNewProperty() { $this->article->ext_someNewProperty = 12; $this->assertEquals( 12, $this->article->ext_someNewProperty, "Article get/set magic on new field" ); @@ -59,7 +59,7 @@ class ArticleTest extends MediaWikiTestCase { /** * Checks for the existence of the backwards compatibility static functions (forwarders to WikiPage class) */ - function testStaticFunctions() { + public function testStaticFunctions() { $this->hideDeprecated( 'Article::getAutosummary' ); $this->hideDeprecated( 'WikiPage::getAutosummary' ); $this->hideDeprecated( 'CategoryPage::getAutosummary' ); // Inherited from Article @@ -76,7 +76,7 @@ class ArticleTest extends MediaWikiTestCase { "Article static functions" ); } - function testWikiPageFactory() { + public function testWikiPageFactory() { $title = Title::makeTitle( NS_FILE, 'Someimage.png' ); $page = WikiPage::factory( $title ); $this->assertEquals( 'WikiFilePage', get_class( $page ) ); diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php index 32fc2c5a8f..21de098549 100644 --- a/tests/phpunit/includes/BlockTest.php +++ b/tests/phpunit/includes/BlockTest.php @@ -66,7 +66,7 @@ class BlockTest extends MediaWikiLangTestCase { } } - function testInitializerFunctionsReturnCorrectBlock() { + public function testInitializerFunctionsReturnCorrectBlock() { // $this->dumpBlocks(); $this->assertTrue( $this->block->equals( Block::newFromTarget( 'UTBlockee' ) ), "newFromTarget() returns the same block as the one that was made" ); @@ -77,7 +77,7 @@ class BlockTest extends MediaWikiLangTestCase { /** * per bug 26425 */ - function testBug26425BlockTimestampDefaultsToTime() { + public function testBug26425BlockTimestampDefaultsToTime() { // delta to stop one-off errors when things happen to go over a second mark. $delta = abs( $this->madeAt - $this->block->mTimestamp ); $this->assertLessThan( 2, $delta, "If no timestamp is specified, the block is recorded as time()" ); @@ -91,7 +91,7 @@ class BlockTest extends MediaWikiLangTestCase { * * @dataProvider provideBug29116Data */ - function testBug29116LoadWithEmptyIp( $vagueTarget ) { + public function testBug29116LoadWithEmptyIp( $vagueTarget ) { $this->hideDeprecated( 'Block::load' ); $uid = User::idFromName( 'UTBlockee' ); @@ -111,7 +111,7 @@ class BlockTest extends MediaWikiLangTestCase { * * @dataProvider provideBug29116Data */ - function testBug29116NewFromTargetWithEmptyIp( $vagueTarget ) { + public function testBug29116NewFromTargetWithEmptyIp( $vagueTarget ) { $block = Block::newFromTarget( 'UTBlockee', $vagueTarget ); $this->assertTrue( $this->block->equals( $block ), "newFromTarget() returns the same block as the one that was made when given empty vagueTarget param " . var_export( $vagueTarget, true ) ); } @@ -124,7 +124,7 @@ class BlockTest extends MediaWikiLangTestCase { ); } - function testBlockedUserCanNotCreateAccount() { + public function testBlockedUserCanNotCreateAccount() { $username = 'BlockedUserToCreateAccountWith'; $u = User::newFromName( $username ); $u->setPassword( 'NotRandomPass' ); @@ -184,7 +184,7 @@ class BlockTest extends MediaWikiLangTestCase { ); } - function testCrappyCrossWikiBlocks() { + public function testCrappyCrossWikiBlocks() { // Delete the last round's block if it's still there $oldBlock = Block::newFromTarget( 'UserOnForeignWiki' ); if ( $oldBlock ) { @@ -344,7 +344,7 @@ class BlockTest extends MediaWikiLangTestCase { /** * @dataProvider providerXff */ - function testBlocksOnXff( $xff, $exCount, $exResult ) { + public function testBlocksOnXff( $xff, $exCount, $exResult ) { $list = array_map( 'trim', explode( ',', $xff ) ); $xffblocks = Block::getBlocksForIPList( $list, true ); $this->assertEquals( $exCount, count( $xffblocks ), 'Number of blocks for ' . $xff ); diff --git a/tests/phpunit/includes/CollationTest.php b/tests/phpunit/includes/CollationTest.php index f1004fbf66..43bb3941fc 100644 --- a/tests/phpunit/includes/CollationTest.php +++ b/tests/phpunit/includes/CollationTest.php @@ -20,7 +20,7 @@ class CollationTest extends MediaWikiLangTestCase { * * @dataProvider prefixDataProvider */ - function testIsPrefix( $lang, $base, $extended ) { + public function testIsPrefix( $lang, $base, $extended ) { $cp = Collator::create( $lang ); $cp->setStrength( Collator::PRIMARY ); $baseBin = $cp->getSortKey( $base ); @@ -53,7 +53,7 @@ class CollationTest extends MediaWikiLangTestCase { * * @dataProvider notPrefixDataProvider */ - function testNotIsPrefix( $lang, $base, $extended ) { + public function testNotIsPrefix( $lang, $base, $extended ) { $cp = Collator::create( $lang ); $cp->setStrength( Collator::PRIMARY ); $baseBin = $cp->getSortKey( $base ); @@ -81,7 +81,7 @@ class CollationTest extends MediaWikiLangTestCase { * * @dataProvider firstLetterProvider */ - function testGetFirstLetter( $collation, $string, $firstLetter ) { + public function testGetFirstLetter( $collation, $string, $firstLetter ) { $col = Collation::factory( $collation ); $this->assertEquals( $firstLetter, $col->getFirstLetter( $string ) ); } diff --git a/tests/phpunit/includes/DiffHistoryBlobTest.php b/tests/phpunit/includes/DiffHistoryBlobTest.php index d927b7a176..a4d5b91a95 100644 --- a/tests/phpunit/includes/DiffHistoryBlobTest.php +++ b/tests/phpunit/includes/DiffHistoryBlobTest.php @@ -24,7 +24,7 @@ class DiffHistoryBlobTest extends MediaWikiTestCase { * Test for DiffHistoryBlob::xdiffAdler32() * @dataProvider provideXdiffAdler32 */ - function testXdiffAdler32( $input ) { + public function testXdiffAdler32( $input ) { $xdiffHash = substr( xdiff_string_rabdiff( $input, '' ), 0, 4 ); $dhb = new DiffHistoryBlob; $myHash = $dhb->xdiffAdler32( $input ); diff --git a/tests/phpunit/includes/EditPageTest.php b/tests/phpunit/includes/EditPageTest.php index 76ef782d11..87272a4c93 100644 --- a/tests/phpunit/includes/EditPageTest.php +++ b/tests/phpunit/includes/EditPageTest.php @@ -14,7 +14,7 @@ class EditPageTest extends MediaWikiLangTestCase { /** * @dataProvider provideExtractSectionTitle */ - function testExtractSectionTitle( $section, $title ) { + public function testExtractSectionTitle( $section, $title ) { $extracted = EditPage::extractSectionTitle( $section ); $this->assertEquals( $title, $extracted ); } diff --git a/tests/phpunit/includes/ExternalStoreTest.php b/tests/phpunit/includes/ExternalStoreTest.php index 99544e7ed0..fcffcbc21a 100644 --- a/tests/phpunit/includes/ExternalStoreTest.php +++ b/tests/phpunit/includes/ExternalStoreTest.php @@ -5,7 +5,7 @@ class ExternalStoreTest extends MediaWikiTestCase { - function testExternalFetchFromURL() { + public function testExternalFetchFromURL() { $this->setMwGlobals( 'wgExternalStores', false ); $this->assertFalse( diff --git a/tests/phpunit/includes/ExtraParserTest.php b/tests/phpunit/includes/ExtraParserTest.php index 07215c121e..6c67beb1ed 100644 --- a/tests/phpunit/includes/ExtraParserTest.php +++ b/tests/phpunit/includes/ExtraParserTest.php @@ -27,7 +27,7 @@ class ExtraParserTest extends MediaWikiTestCase { } // Bug 8689 - Long numeric lines kill the parser - function testBug8689() { + public function testBug8689() { global $wgUser; $longLine = '1.' . str_repeat( '1234567890', 100000 ) . "\n"; @@ -38,13 +38,13 @@ class ExtraParserTest extends MediaWikiTestCase { } /* Test the parser entry points */ - function testParse() { + public function testParse() { $title = Title::newFromText( __FUNCTION__ ); $parserOutput = $this->parser->parse( "Test\n{{Foo}}\n{{Bar}}", $title, $this->options ); $this->assertEquals( "

Test\nContent of Template:Foo\nContent of Template:Bar\n

", $parserOutput->getText() ); } - function testPreSaveTransform() { + public function testPreSaveTransform() { global $wgUser; $title = Title::newFromText( __FUNCTION__ ); $outputText = $this->parser->preSaveTransform( "Test\r\n{{subst:Foo}}\n{{Bar}}", $title, $wgUser, $this->options ); @@ -52,7 +52,7 @@ class ExtraParserTest extends MediaWikiTestCase { $this->assertEquals( "Test\nContent of ''Template:Foo''\n{{Bar}}", $outputText ); } - function testPreprocess() { + public function testPreprocess() { $title = Title::newFromText( __FUNCTION__ ); $outputText = $this->parser->preprocess( "Test\n{{Foo}}\n{{Bar}}", $title, $this->options ); @@ -62,7 +62,7 @@ class ExtraParserTest extends MediaWikiTestCase { /** * cleanSig() makes all templates substs and removes tildes */ - function testCleanSig() { + public function testCleanSig() { $title = Title::newFromText( __FUNCTION__ ); $outputText = $this->parser->cleanSig( "{{Foo}} ~~~~" ); @@ -72,7 +72,7 @@ class ExtraParserTest extends MediaWikiTestCase { /** * cleanSig() should do nothing if disabled */ - function testCleanSigDisabled() { + public function testCleanSigDisabled() { $this->setMwGlobals( 'wgCleanSignatures', false ); $title = Title::newFromText( __FUNCTION__ ); @@ -85,7 +85,7 @@ class ExtraParserTest extends MediaWikiTestCase { * cleanSigInSig() just removes tildes * @dataProvider provideStringsForCleanSigInSig */ - function testCleanSigInSig( $in, $out ) { + public function testCleanSigInSig( $in, $out ) { $this->assertEquals( Parser::cleanSigInSig( $in ), $out ); } @@ -97,7 +97,7 @@ class ExtraParserTest extends MediaWikiTestCase { ); } - function testGetSection() { + public function testGetSection() { $outputText2 = $this->parser->getSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 2 ); $outputText1 = $this->parser->getSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 1 ); @@ -105,7 +105,7 @@ class ExtraParserTest extends MediaWikiTestCase { $this->assertEquals( "== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2", $outputText1 ); } - function testReplaceSection() { + public function testReplaceSection() { $outputText = $this->parser->replaceSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 1, "New section 1" ); $this->assertEquals( "Section 0\nNew section 1\n\n== Heading 3 ==\nSection 3", $outputText ); @@ -114,7 +114,7 @@ class ExtraParserTest extends MediaWikiTestCase { /** * Templates and comments are not affected, but noinclude/onlyinclude is. */ - function testGetPreloadText() { + public function testGetPreloadText() { $title = Title::newFromText( __FUNCTION__ ); $outputText = $this->parser->getPreloadText( "{{Foo}} censored information ", $title, $this->options ); @@ -134,7 +134,7 @@ class ExtraParserTest extends MediaWikiTestCase { /** * @group Database */ - function testTrackingCategory() { + public function testTrackingCategory() { $title = Title::newFromText( __FUNCTION__ ); $catName = wfMessage( 'broken-file-category' )->inContentLanguage()->text(); $cat = Title::makeTitleSafe( NS_CATEGORY, $catName ); @@ -147,7 +147,7 @@ class ExtraParserTest extends MediaWikiTestCase { /** * @group Database */ - function testTrackingCategorySpecial() { + public function testTrackingCategorySpecial() { // Special pages shouldn't have tracking cats. $title = SpecialPage::getTitleFor( 'Contributions' ); $parserOutput = $this->parser->parse( "[[file:nonexistent]]", $title, $this->options ); diff --git a/tests/phpunit/includes/FauxRequestTest.php b/tests/phpunit/includes/FauxRequestTest.php index dfb0f13ca5..9f3aa11dad 100644 --- a/tests/phpunit/includes/FauxRequestTest.php +++ b/tests/phpunit/includes/FauxRequestTest.php @@ -2,7 +2,7 @@ class FauxRequestTest extends MediaWikiTestCase { - function testGetSetHeader() { + public function testGetSetHeader() { $value = 'test/test'; $request = new FauxRequest(); diff --git a/tests/phpunit/includes/FauxResponseTest.php b/tests/phpunit/includes/FauxResponseTest.php index 977c22bc83..f9ba1b3bf9 100644 --- a/tests/phpunit/includes/FauxResponseTest.php +++ b/tests/phpunit/includes/FauxResponseTest.php @@ -30,13 +30,13 @@ class FauxResponseTest extends MediaWikiTestCase { $this->response = new FauxResponse; } - function testCookie() { + public function testCookie() { $this->assertEquals( null, $this->response->getcookie( 'key' ), 'Non-existing cookie' ); $this->response->setcookie( 'key', 'val' ); $this->assertEquals( 'val', $this->response->getcookie( 'key' ), 'Existing cookie' ); } - function testHeader() { + public function testHeader() { $this->assertEquals( null, $this->response->getheader( 'Location' ), 'Non-existing header' ); $this->response->header( 'Location: http://localhost/' ); @@ -52,7 +52,7 @@ class FauxResponseTest extends MediaWikiTestCase { $this->assertEquals( 'http://localhost/', $this->response->getheader( 'LOCATION' ), 'Get header case insensitive' ); } - function testResponseCode() { + public function testResponseCode() { $this->response->header( 'HTTP/1.1 200' ); $this->assertEquals( 200, $this->response->getStatusCode(), 'Header with no message' ); diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index 244b100ec1..9b719995e9 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -53,25 +53,25 @@ class GlobalTest extends MediaWikiTestCase { ); } - function testRandom() { + public function testRandom() { # This could hypothetically fail, but it shouldn't ;) $this->assertFalse( wfRandom() == wfRandom() ); } - function testUrlencode() { + public function testUrlencode() { $this->assertEquals( "%E7%89%B9%E5%88%A5:Contributions/Foobar", wfUrlencode( "\xE7\x89\xB9\xE5\x88\xA5:Contributions/Foobar" ) ); } - function testExpandIRI() { + public function testExpandIRI() { $this->assertEquals( "https://te.wikibooks.org/wiki/ఉబుంటు_వాడుకరి_మార్గదర్శని", wfExpandIRI( "https://te.wikibooks.org/wiki/%E0%B0%89%E0%B0%AC%E0%B1%81%E0%B0%82%E0%B0%9F%E0%B1%81_%E0%B0%B5%E0%B0%BE%E0%B0%A1%E0%B1%81%E0%B0%95%E0%B0%B0%E0%B0%BF_%E0%B0%AE%E0%B0%BE%E0%B0%B0%E0%B1%8D%E0%B0%97%E0%B0%A6%E0%B0%B0%E0%B1%8D%E0%B0%B6%E0%B0%A8%E0%B0%BF" ) ); } - function testReadOnlyEmpty() { + public function testReadOnlyEmpty() { global $wgReadOnly; $wgReadOnly = null; @@ -79,7 +79,7 @@ class GlobalTest extends MediaWikiTestCase { $this->assertFalse( wfReadOnly() ); } - function testReadOnlySet() { + public function testReadOnlySet() { global $wgReadOnly, $wgReadOnlyFile; $f = fopen( $wgReadOnlyFile, "wt" ); @@ -97,7 +97,7 @@ class GlobalTest extends MediaWikiTestCase { $this->assertFalse( wfReadOnly() ); } - function testQuotedPrintable() { + public function testQuotedPrintable() { $this->assertEquals( "=?UTF-8?Q?=C4=88u=20legebla=3F?=", UserMailer::quotedPrintable( "\xc4\x88u legebla?", "UTF-8" ) ); @@ -124,12 +124,12 @@ class GlobalTest extends MediaWikiTestCase { /** * @dataProvider provideArrayToCGI */ - function testArrayToCGI( $array, $result ) { + public function testArrayToCGI( $array, $result ) { $this->assertEquals( $result, wfArrayToCgi( $array ) ); } - function testArrayToCGI2() { + public function testArrayToCGI2() { $this->assertEquals( "baz=bar&foo=bar", wfArrayToCgi( @@ -155,7 +155,7 @@ class GlobalTest extends MediaWikiTestCase { /** * @dataProvider provideCgiToArray */ - function testCgiToArray( $cgi, $result ) { + public function testCgiToArray( $cgi, $result ) { $this->assertEquals( $result, wfCgiToArray( $cgi ) ); } @@ -175,11 +175,11 @@ class GlobalTest extends MediaWikiTestCase { /** * @dataProvider provideCgiRoundTrip */ - function testCgiRoundTrip( $cgi ) { + public function testCgiRoundTrip( $cgi ) { $this->assertEquals( $cgi, wfArrayToCgi( wfCgiToArray( $cgi ) ) ); } - function testMimeTypeMatch() { + public function testMimeTypeMatch() { $this->assertEquals( 'text/html', mimeTypeMatch( 'text/html', @@ -201,7 +201,7 @@ class GlobalTest extends MediaWikiTestCase { 'image/svg+xml' => 0.5 ) ) ); } - function testNegotiateType() { + public function testNegotiateType() { $this->assertEquals( 'text/html', wfNegotiateType( @@ -242,7 +242,7 @@ class GlobalTest extends MediaWikiTestCase { array( 'application/xhtml+xml' => 1.0 ) ) ); } - function testFallbackMbstringFunctions() { + public function testFallbackMbstringFunctions() { if ( !extension_loaded( 'mbstring' ) ) { $this->markTestSkipped( "The mb_string functions must be installed to test the fallback functions" ); @@ -308,7 +308,7 @@ class GlobalTest extends MediaWikiTestCase { } - function testDebugFunctionTest() { + public function testDebugFunctionTest() { global $wgDebugLogFile, $wgDebugTimestamps; @@ -342,7 +342,7 @@ class GlobalTest extends MediaWikiTestCase { $wgDebugTimestamps = $old_wgDebugTimestamps; } - function testClientAcceptsGzipTest() { + public function testClientAcceptsGzipTest() { $settings = array( 'gzip' => true, @@ -373,7 +373,7 @@ class GlobalTest extends MediaWikiTestCase { } } - function testSwapVarsTest() { + public function testSwapVarsTest() { $var1 = 1; $var2 = 2; @@ -386,7 +386,7 @@ class GlobalTest extends MediaWikiTestCase { $this->assertEquals( $var2, 1, 'var2 is swapped' ); } - function testWfPercentTest() { + public function testWfPercentTest() { $pcts = array( array( 6 / 7, '0.86%', 2, false ), @@ -550,7 +550,7 @@ class GlobalTest extends MediaWikiTestCase { /** * @dataProvider provideMakeUrlIndexes() */ - function testMakeUrlIndexes( $url, $expected ) { + public function testMakeUrlIndexes( $url, $expected ) { $index = wfMakeUrlIndexes( $url ); $this->assertEquals( $expected, $index, "wfMakeUrlIndexes(\"$url\")" ); } @@ -607,7 +607,7 @@ class GlobalTest extends MediaWikiTestCase { /** * @dataProvider provideWfMatchesDomainList */ - function testWfMatchesDomainList( $url, $domains, $expected, $description ) { + public function testWfMatchesDomainList( $url, $domains, $expected, $description ) { $actual = wfMatchesDomainList( $url, $domains ); $this->assertEquals( $expected, $actual, $description ); } @@ -630,7 +630,7 @@ class GlobalTest extends MediaWikiTestCase { return $a; } - function testWfMkdirParents() { + public function testWfMkdirParents() { // Should not return true if file exists instead of directory $fname = $this->getNewTempFile(); wfSuppressWarnings(); @@ -642,7 +642,7 @@ class GlobalTest extends MediaWikiTestCase { /** * @dataProvider provideWfShellMaintenanceCmdList */ - function testWfShellMaintenanceCmd( $script, $parameters, $options, $expected, $description ) { + public function testWfShellMaintenanceCmd( $script, $parameters, $options, $expected, $description ) { if ( wfIsWindows() ) { // Approximation that's good enough for our purposes just now $expected = str_replace( "'", '"', $expected ); diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php index 8bd0849b26..8d1529618d 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php @@ -7,7 +7,7 @@ class GlobalWithDBTest extends MediaWikiTestCase { /** * @dataProvider provideWfIsBadImageList */ - function testWfIsBadImage( $name, $title, $blacklist, $expected, $desc ) { + public function testWfIsBadImage( $name, $title, $blacklist, $expected, $desc ) { $this->assertEquals( $expected, wfIsBadImage( $name, $title, $blacklist ), $desc ); } diff --git a/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php b/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php index baf9ceea4b..def443ce99 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php +++ b/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php @@ -13,7 +13,7 @@ class WfBCP47Test extends MediaWikiTestCase { * @see http://tools.ietf.org/html/bcp47 * @dataProvider provideLanguageCodes() */ - function testBCP47( $code, $expected ) { + public function testBCP47( $code, $expected ) { $code = strtolower( $code ); $this->assertEquals( $expected, wfBCP47( $code ), "Applying BCP47 standard to lower case '$code'" diff --git a/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php b/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php index 3c4fa20007..be2b222e0e 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php @@ -6,7 +6,7 @@ class WfBaseNameTest extends MediaWikiTestCase { /** * @dataProvider providePaths */ - function testBaseName( $fullpath, $basename ) { + public function testBaseName( $fullpath, $basename ) { $this->assertEquals( $basename, wfBaseName( $fullpath ), "wfBaseName('$fullpath') => '$basename'" ); } diff --git a/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php b/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php index 3521d18a4b..a1488153c7 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php @@ -2,7 +2,7 @@ class WfGetCallerTest extends MediaWikiTestCase { - function testZero() { + public function testZero() { $this->assertEquals( __METHOD__, wfGetCaller( 1 ) ); } @@ -10,7 +10,7 @@ class WfGetCallerTest extends MediaWikiTestCase { return wfGetCaller(); } - function testOne() { + public function testOne() { $this->assertEquals( 'WfGetCallerTest::testOne', self::callerOne() ); } @@ -22,11 +22,11 @@ class WfGetCallerTest extends MediaWikiTestCase { return wfGetCaller( $level ); } - function testTwo() { + public function testTwo() { $this->assertEquals( 'WfGetCallerTest::testTwo', self::intermediateFunction() ); } - function testN() { + public function testN() { $this->assertEquals( 'WfGetCallerTest::testN', self::intermediateFunction( 2, 0 ) ); $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( 1, 0 ) ); diff --git a/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php b/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php index 604f901479..485a3622f5 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php @@ -4,7 +4,7 @@ class WfShorthandToIntegerTest extends MediaWikiTestCase { /** * @dataProvider provideABunchOfShorthands */ - function testWfShorthandToInteger( $input, $output, $description ) { + public function testWfShorthandToInteger( $input, $output, $description ) { $this->assertEquals( wfShorthandToInteger( $input ), $output, diff --git a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php index 32bb49dc34..419832219d 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php @@ -6,7 +6,7 @@ class WfTimestampTest extends MediaWikiTestCase { /** * @dataProvider provideNormalTimestamps */ - function testNormalTimestamps( $input, $format, $output, $desc ) { + public function testNormalTimestamps( $input, $format, $output, $desc ) { $this->assertEquals( $output, wfTimestamp( $format, $input ), $desc ); } @@ -57,7 +57,7 @@ class WfTimestampTest extends MediaWikiTestCase { * See r74778 and bug 25451 * @dataProvider provideOldTimestamps */ - function testOldTimestamps( $input, $format, $output, $desc ) { + public function testOldTimestamps( $input, $format, $output, $desc ) { $this->assertEquals( $output, wfTimestamp( $format, $input ), $desc ); } @@ -96,7 +96,7 @@ class WfTimestampTest extends MediaWikiTestCase { * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 * @dataProvider provideHttpDates */ - function testHttpDate( $input, $output, $desc ) { + public function testHttpDate( $input, $output, $desc ) { $this->assertEquals( $output, wfTimestamp( TS_MW, $input ), $desc ); } @@ -114,7 +114,7 @@ class WfTimestampTest extends MediaWikiTestCase { * There are a number of assumptions in our codebase where wfTimestamp() * should give the current date but it is not given a 0 there. See r71751 CR */ - function testTimestampParameter() { + public function testTimestampParameter() { $now = wfTimestamp( TS_UNIX ); // We check that wfTimestamp doesn't return false (error) and use a LessThan assert // for the cases where the test is run in a second boundary. diff --git a/tests/phpunit/includes/HashRingTest.php b/tests/phpunit/includes/HashRingTest.php index bc4e499c29..65f1369619 100644 --- a/tests/phpunit/includes/HashRingTest.php +++ b/tests/phpunit/includes/HashRingTest.php @@ -4,7 +4,7 @@ * @group HashRing */ class HashRingTest extends MediaWikiTestCase { - function testHashRing() { + public function testHashRing() { $ring = new HashRing( array( 's1' => 1, 's2' => 1, 's3' => 2, 's4' => 2, 's5' => 2, 's6' => 3 ) ); $locations = array(); diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php index ecfe418274..1c62d0324a 100644 --- a/tests/phpunit/includes/HtmlTest.php +++ b/tests/phpunit/includes/HtmlTest.php @@ -250,7 +250,7 @@ class HtmlTest extends MediaWikiTestCase { * Test feature added by r96188, let pass attributes values as * a PHP array. Restricted to class,rel, accesskey. */ - function testExpandAttributesSpaceSeparatedAttributesWithBoolean() { + public function testExpandAttributesSpaceSeparatedAttributesWithBoolean() { $this->assertEquals( ' class="booltrue one"', Html::expandAttributes( array( 'class' => array( @@ -274,7 +274,7 @@ class HtmlTest extends MediaWikiTestCase { * * Feature added by r96188 */ - function testValueIsAuthoritativeInSpaceSeparatedAttributesArrays() { + public function testValueIsAuthoritativeInSpaceSeparatedAttributesArrays() { $this->assertEquals( ' class=""', Html::expandAttributes( array( 'class' => array( @@ -285,7 +285,7 @@ class HtmlTest extends MediaWikiTestCase { ); } - function testNamespaceSelector() { + public function testNamespaceSelector() { $this->assertEquals( '' . "\n" . '' . "\n" . @@ -386,7 +386,7 @@ class HtmlTest extends MediaWikiTestCase { ); } - function testCanDisableANamespaces() { + public function testCanDisableANamespaces() { $this->assertEquals( '', Html::element( 'input', array( 'type' => $HTML5InputType ) ), @@ -457,7 +457,7 @@ class HtmlTest extends MediaWikiTestCase { * @covers Html::dropDefaults * @dataProvider provideElementsWithAttributesHavingDefaultValues */ - function testDropDefaults( $expected, $element, $attribs, $message = '' ) { + public function testDropDefaults( $expected, $element, $attribs, $message = '' ) { $this->assertEquals( $expected, Html::element( $element, $attribs ), $message ); } diff --git a/tests/phpunit/includes/HttpTest.php b/tests/phpunit/includes/HttpTest.php index 6e0aa88223..11d8ed6059 100644 --- a/tests/phpunit/includes/HttpTest.php +++ b/tests/phpunit/includes/HttpTest.php @@ -53,7 +53,7 @@ class HttpTest extends MediaWikiTestCase { * @dataProvider provideURI * @covers Http::isValidURI */ - function testIsValidUri( $expect, $URI, $message = '' ) { + public function testIsValidUri( $expect, $URI, $message = '' ) { $this->assertEquals( $expect, (bool)Http::isValidURI( $URI ), diff --git a/tests/phpunit/includes/IPTest.php b/tests/phpunit/includes/IPTest.php index 22bf0c0cd3..c074eea695 100644 --- a/tests/phpunit/includes/IPTest.php +++ b/tests/phpunit/includes/IPTest.php @@ -392,7 +392,7 @@ class IPTest extends MediaWikiTestCase { * representing the network mask and the bit mask. * @covers IP::parseCIDR */ - function testCIDRParsing() { + public function testCIDRParsing() { $this->assertFalseCIDR( '192.0.2.0', "missing mask" ); $this->assertFalseCIDR( '192.0.2.0/', "missing bitmask" ); @@ -489,7 +489,7 @@ class IPTest extends MediaWikiTestCase { * Test for IP::splitHostAndPort(). * @dataProvider provideSplitHostAndPort */ - function testSplitHostAndPort( $expected, $input, $description ) { + public function testSplitHostAndPort( $expected, $input, $description ) { $this->assertEquals( $expected, IP::splitHostAndPort( $input ), $description ); } @@ -516,7 +516,7 @@ class IPTest extends MediaWikiTestCase { * Test for IP::combineHostAndPort() * @dataProvider provideCombineHostAndPort */ - function testCombineHostAndPort( $expected, $input, $description ) { + public function testCombineHostAndPort( $expected, $input, $description ) { list( $host, $port, $defaultPort ) = $input; $this->assertEquals( $expected, @@ -540,7 +540,7 @@ class IPTest extends MediaWikiTestCase { * Test for IP::sanitizeRange() * @dataProvider provideIPCIDRs */ - function testSanitizeRange( $input, $expected, $description ) { + public function testSanitizeRange( $input, $expected, $description ) { $this->assertEquals( $expected, IP::sanitizeRange( $input ), $description ); } @@ -564,7 +564,7 @@ class IPTest extends MediaWikiTestCase { * Test for IP::prettifyIP() * @dataProvider provideIPsToPrettify */ - function testPrettifyIP( $ip, $prettified ) { + public function testPrettifyIP( $ip, $prettified ) { $this->assertEquals( $prettified, IP::prettifyIP( $ip ), "Prettify of $ip" ); } diff --git a/tests/phpunit/includes/LanguageConverterTest.php b/tests/phpunit/includes/LanguageConverterTest.php index 070a680f1d..7c2134b907 100644 --- a/tests/phpunit/includes/LanguageConverterTest.php +++ b/tests/phpunit/includes/LanguageConverterTest.php @@ -30,39 +30,39 @@ class LanguageConverterTest extends MediaWikiLangTestCase { parent::tearDown(); } - function testGetPreferredVariantDefaults() { + public function testGetPreferredVariantDefaults() { $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); } - function testGetPreferredVariantHeaders() { + public function testGetPreferredVariantHeaders() { global $wgRequest; $wgRequest->setHeader( 'Accept-Language', 'tg-latn' ); $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); } - function testGetPreferredVariantHeaderWeight() { + public function testGetPreferredVariantHeaderWeight() { global $wgRequest; $wgRequest->setHeader( 'Accept-Language', 'tg;q=1' ); $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); } - function testGetPreferredVariantHeaderWeight2() { + public function testGetPreferredVariantHeaderWeight2() { global $wgRequest; $wgRequest->setHeader( 'Accept-Language', 'tg-latn;q=1' ); $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); } - function testGetPreferredVariantHeaderMulti() { + public function testGetPreferredVariantHeaderMulti() { global $wgRequest; $wgRequest->setHeader( 'Accept-Language', 'en, tg-latn;q=1' ); $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); } - function testGetPreferredVariantUserOption() { + public function testGetPreferredVariantUserOption() { global $wgUser; $wgUser = new User; @@ -75,7 +75,7 @@ class LanguageConverterTest extends MediaWikiLangTestCase { $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); } - function testGetPreferredVariantUserOptionForForeignLanguage() { + public function testGetPreferredVariantUserOptionForForeignLanguage() { global $wgContLang, $wgUser; $wgContLang = Language::factory( 'en' ); @@ -89,7 +89,7 @@ class LanguageConverterTest extends MediaWikiLangTestCase { $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); } - function testGetPreferredVariantHeaderUserVsUrl() { + public function testGetPreferredVariantHeaderUserVsUrl() { global $wgContLang, $wgRequest, $wgUser; $wgContLang = Language::factory( 'tg-latn' ); @@ -104,14 +104,14 @@ class LanguageConverterTest extends MediaWikiLangTestCase { } - function testGetPreferredVariantDefaultLanguageVariant() { + public function testGetPreferredVariantDefaultLanguageVariant() { global $wgDefaultLanguageVariant; $wgDefaultLanguageVariant = 'tg-latn'; $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); } - function testGetPreferredVariantDefaultLanguageVsUrlVariant() { + public function testGetPreferredVariantDefaultLanguageVsUrlVariant() { global $wgDefaultLanguageVariant, $wgRequest, $wgContLang; $wgContLang = Language::factory( 'tg-latn' ); diff --git a/tests/phpunit/includes/LicensesTest.php b/tests/phpunit/includes/LicensesTest.php index 212b3b3bf0..478a2ffc2a 100644 --- a/tests/phpunit/includes/LicensesTest.php +++ b/tests/phpunit/includes/LicensesTest.php @@ -2,7 +2,7 @@ class LicensesTest extends MediaWikiTestCase { - function testLicenses() { + public function testLicenses() { $str = " * Free licenses: ** GFDL|Debian disagrees diff --git a/tests/phpunit/includes/LinkerTest.php b/tests/phpunit/includes/LinkerTest.php index ec4d98ec4f..b605f08f16 100644 --- a/tests/phpunit/includes/LinkerTest.php +++ b/tests/phpunit/includes/LinkerTest.php @@ -6,7 +6,7 @@ class LinkerTest extends MediaWikiLangTestCase { * @dataProvider provideCasesForUserLink * @covers Linker::userLink */ - function testUserLink( $expected, $userId, $userName, $altUserName = false, $msg = '' ) { + public function testUserLink( $expected, $userId, $userName, $altUserName = false, $msg = '' ) { $this->setMwGlobals( array( 'wgArticlePath' => '/wiki/$1', 'wgWellFormedXml' => true, diff --git a/tests/phpunit/includes/LocalFileTest.php b/tests/phpunit/includes/LocalFileTest.php index d6f0d2eeaa..2501c78305 100644 --- a/tests/phpunit/includes/LocalFileTest.php +++ b/tests/phpunit/includes/LocalFileTest.php @@ -35,72 +35,72 @@ class LocalFileTest extends MediaWikiTestCase { $this->file_lc = $this->repo_lc->newFile( 'test!' ); } - function testGetHashPath() { + public function testGetHashPath() { $this->assertEquals( '', $this->file_hl0->getHashPath() ); $this->assertEquals( 'a/a2/', $this->file_hl2->getHashPath() ); $this->assertEquals( 'c/c4/', $this->file_lc->getHashPath() ); } - function testGetRel() { + public function testGetRel() { $this->assertEquals( 'Test!', $this->file_hl0->getRel() ); $this->assertEquals( 'a/a2/Test!', $this->file_hl2->getRel() ); $this->assertEquals( 'c/c4/test!', $this->file_lc->getRel() ); } - function testGetUrlRel() { + public function testGetUrlRel() { $this->assertEquals( 'Test%21', $this->file_hl0->getUrlRel() ); $this->assertEquals( 'a/a2/Test%21', $this->file_hl2->getUrlRel() ); $this->assertEquals( 'c/c4/test%21', $this->file_lc->getUrlRel() ); } - function testGetArchivePath() { + public function testGetArchivePath() { $this->assertEquals( 'mwstore://local-backend/test-public/archive', $this->file_hl0->getArchivePath() ); $this->assertEquals( 'mwstore://local-backend/test-public/archive/a/a2', $this->file_hl2->getArchivePath() ); $this->assertEquals( 'mwstore://local-backend/test-public/archive/!', $this->file_hl0->getArchivePath( '!' ) ); $this->assertEquals( 'mwstore://local-backend/test-public/archive/a/a2/!', $this->file_hl2->getArchivePath( '!' ) ); } - function testGetThumbPath() { + public function testGetThumbPath() { $this->assertEquals( 'mwstore://local-backend/test-thumb/Test!', $this->file_hl0->getThumbPath() ); $this->assertEquals( 'mwstore://local-backend/test-thumb/a/a2/Test!', $this->file_hl2->getThumbPath() ); $this->assertEquals( 'mwstore://local-backend/test-thumb/Test!/x', $this->file_hl0->getThumbPath( 'x' ) ); $this->assertEquals( 'mwstore://local-backend/test-thumb/a/a2/Test!/x', $this->file_hl2->getThumbPath( 'x' ) ); } - function testGetArchiveUrl() { + public function testGetArchiveUrl() { $this->assertEquals( '/testurl/archive', $this->file_hl0->getArchiveUrl() ); $this->assertEquals( '/testurl/archive/a/a2', $this->file_hl2->getArchiveUrl() ); $this->assertEquals( '/testurl/archive/%21', $this->file_hl0->getArchiveUrl( '!' ) ); $this->assertEquals( '/testurl/archive/a/a2/%21', $this->file_hl2->getArchiveUrl( '!' ) ); } - function testGetThumbUrl() { + public function testGetThumbUrl() { $this->assertEquals( '/testurl/thumb/Test%21', $this->file_hl0->getThumbUrl() ); $this->assertEquals( '/testurl/thumb/a/a2/Test%21', $this->file_hl2->getThumbUrl() ); $this->assertEquals( '/testurl/thumb/Test%21/x', $this->file_hl0->getThumbUrl( 'x' ) ); $this->assertEquals( '/testurl/thumb/a/a2/Test%21/x', $this->file_hl2->getThumbUrl( 'x' ) ); } - function testGetArchiveVirtualUrl() { + public function testGetArchiveVirtualUrl() { $this->assertEquals( 'mwrepo://test/public/archive', $this->file_hl0->getArchiveVirtualUrl() ); $this->assertEquals( 'mwrepo://test/public/archive/a/a2', $this->file_hl2->getArchiveVirtualUrl() ); $this->assertEquals( 'mwrepo://test/public/archive/%21', $this->file_hl0->getArchiveVirtualUrl( '!' ) ); $this->assertEquals( 'mwrepo://test/public/archive/a/a2/%21', $this->file_hl2->getArchiveVirtualUrl( '!' ) ); } - function testGetThumbVirtualUrl() { + public function testGetThumbVirtualUrl() { $this->assertEquals( 'mwrepo://test/thumb/Test%21', $this->file_hl0->getThumbVirtualUrl() ); $this->assertEquals( 'mwrepo://test/thumb/a/a2/Test%21', $this->file_hl2->getThumbVirtualUrl() ); $this->assertEquals( 'mwrepo://test/thumb/Test%21/%21', $this->file_hl0->getThumbVirtualUrl( '!' ) ); $this->assertEquals( 'mwrepo://test/thumb/a/a2/Test%21/%21', $this->file_hl2->getThumbVirtualUrl( '!' ) ); } - function testGetUrl() { + public function testGetUrl() { $this->assertEquals( '/testurl/Test%21', $this->file_hl0->getUrl() ); $this->assertEquals( '/testurl/a/a2/Test%21', $this->file_hl2->getUrl() ); } - function testWfLocalFile() { + public function testWfLocalFile() { $file = wfLocalFile( "File:Some_file_that_probably_doesn't exist.png" ); $this->assertThat( $file, $this->isInstanceOf( 'LocalFile' ), 'wfLocalFile() returns LocalFile for valid Titles' ); } diff --git a/tests/phpunit/includes/MWFunctionTest.php b/tests/phpunit/includes/MWFunctionTest.php index a44f69eea3..d86f2c9bc5 100644 --- a/tests/phpunit/includes/MWFunctionTest.php +++ b/tests/phpunit/includes/MWFunctionTest.php @@ -1,7 +1,7 @@ assertTrue( wfMessage( 'mainpage' )->exists() ); $this->assertTrue( wfMessage( 'mainpage' )->params( array() )->exists() ); $this->assertTrue( wfMessage( 'mainpage' )->rawParams( 'foo', 123 )->exists() ); @@ -19,7 +19,7 @@ class MessageTest extends MediaWikiLangTestCase { $this->assertFalse( wfMessage( 'i-dont-exist-evar' )->rawParams( 'foo', 123 )->exists() ); } - function testKey() { + public function testKey() { $this->assertInstanceOf( 'Message', wfMessage( 'mainpage' ) ); $this->assertInstanceOf( 'Message', wfMessage( 'i-dont-exist-evar' ) ); $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->text() ); @@ -28,28 +28,28 @@ class MessageTest extends MediaWikiLangTestCase { $this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->escaped() ); } - function testInLanguage() { + public function testInLanguage() { $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( 'en' )->text() ); $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() ); $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'en' ) )->text() ); $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'ru' ) )->text() ); } - function testMessageParams() { + public function testMessageParams() { $this->assertEquals( 'Return to $1.', wfMessage( 'returnto' )->text() ); $this->assertEquals( 'Return to $1.', wfMessage( 'returnto', array() )->text() ); $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', 'foo', 'bar' )->text() ); $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', array( 'foo', 'bar' ) )->text() ); } - function testMessageParamSubstitution() { + public function testMessageParamSubstitution() { $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses', 'Заглавная страница' )->plain() ); $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses', 'Заглавная страница $1' )->plain() ); $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница' )->plain() ); $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница $1' )->plain() ); } - function testDeliciouslyManyParams() { + public function testDeliciouslyManyParams() { $msg = new RawMessage( '$1$2$3$4$5$6$7$8$9$10$11$12' ); // One less than above has placeholders $params = array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k' ); @@ -60,7 +60,7 @@ class MessageTest extends MediaWikiLangTestCase { * FIXME: This should not need database, but Language#formatExpiry does (bug 55912) * @group Database */ - function testMessageParamTypes() { + public function testMessageParamTypes() { $lang = Language::factory( 'en' ); $msg = new RawMessage( '$1' ); @@ -106,13 +106,13 @@ class MessageTest extends MediaWikiLangTestCase { ); } - function testInContentLanguageDisabled() { + public function testInContentLanguageDisabled() { $this->setMwGlobals( 'wgLang', Language::factory( 'fr' ) ); $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg disabled' ); } - function testInContentLanguageEnabled() { + public function testInContentLanguageEnabled() { $this->setMwGlobals( array( 'wgLang' => Language::factory( 'fr' ), 'wgForceUIMsgAsContentMsg' => array( 'mainpage' ), @@ -124,7 +124,7 @@ class MessageTest extends MediaWikiLangTestCase { /** * @expectedException MWException */ - function testInLanguageThrows() { + public function testInLanguageThrows() { wfMessage( 'foo' )->inLanguage( 123 ); } } diff --git a/tests/phpunit/includes/SampleTest.php b/tests/phpunit/includes/SampleTest.php index 8a881915ad..8516a4cea7 100644 --- a/tests/phpunit/includes/SampleTest.php +++ b/tests/phpunit/includes/SampleTest.php @@ -33,7 +33,7 @@ class TestSample extends MediaWikiLangTestCase { * "Agile Documentation" at * http://www.phpunit.de/manual/3.4/en/other-uses-for-tests.html */ - function testTitleObjectStringConversion() { + public function testTitleObjectStringConversion() { $title = Title::newFromText( "text" ); $this->assertInstanceOf( 'Title', $title, "Title creation" ); $this->assertEquals( "Text", $title, "Automatic string conversion" ); @@ -98,7 +98,7 @@ class TestSample extends MediaWikiLangTestCase { * @expectedException MWException object * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException */ - function testTitleObjectFromObject() { + public function testTitleObjectFromObject() { $title = Title::newFromText( Title::newFromText( "test" ) ); $this->assertEquals( "Test", $title->isLocal() ); } diff --git a/tests/phpunit/includes/StringUtilsTest.php b/tests/phpunit/includes/StringUtilsTest.php index b2228121ad..89759e5c70 100644 --- a/tests/phpunit/includes/StringUtilsTest.php +++ b/tests/phpunit/includes/StringUtilsTest.php @@ -9,7 +9,7 @@ class StringUtilsTest extends MediaWikiTestCase { * @covers StringUtils::isUtf8 * @dataProvider provideStringsForIsUtf8Check */ - function testIsUtf8WithMbstring( $expected, $string ) { + public function testIsUtf8WithMbstring( $expected, $string ) { if ( !function_exists( 'mb_check_encoding' ) ) { $this->markTestSkipped( 'Test requires the mbstring PHP extension' ); } @@ -27,7 +27,7 @@ class StringUtilsTest extends MediaWikiTestCase { * @covers StringUtils::isUtf8 * @dataProvider provideStringsForIsUtf8Check */ - function testIsUtf8WithPhpFallbackImplementation( $expected, $string ) { + public function testIsUtf8WithPhpFallbackImplementation( $expected, $string ) { $this->assertEquals( $expected, StringUtils::isUtf8( $string, /** disable mbstring: */true ), 'Testing string "' . $this->escaped( $string ) . '" with pure PHP implementation' diff --git a/tests/phpunit/includes/TemplateCategoriesTest.php b/tests/phpunit/includes/TemplateCategoriesTest.php index 906aebd9d2..fb63a564db 100644 --- a/tests/phpunit/includes/TemplateCategoriesTest.php +++ b/tests/phpunit/includes/TemplateCategoriesTest.php @@ -10,7 +10,7 @@ class TemplateCategoriesTest extends MediaWikiLangTestCase { /** * @covers Title::getParentCategories */ - function testTemplateCategories() { + public function testTemplateCategories() { $title = Title::newFromText( "Categorized from template" ); $page = WikiPage::factory( $title ); $user = new User(); diff --git a/tests/phpunit/includes/WebRequestTest.php b/tests/phpunit/includes/WebRequestTest.php index a600188b9f..f8ed14b646 100644 --- a/tests/phpunit/includes/WebRequestTest.php +++ b/tests/phpunit/includes/WebRequestTest.php @@ -22,7 +22,7 @@ class WebRequestTest extends MediaWikiTestCase { * @dataProvider provideDetectServer * @covers WebRequest::detectServer */ - function testDetectServer( $expected, $input, $description ) { + public function testDetectServer( $expected, $input, $description ) { $_SERVER = $input; $result = WebRequest::detectServer(); $this->assertEquals( $expected, $result, $description ); @@ -106,7 +106,7 @@ class WebRequestTest extends MediaWikiTestCase { * @dataProvider provideGetIP * @covers WebRequest::getIP */ - function testGetIP( $expected, $input, $squid, $xffList, $private, $description ) { + public function testGetIP( $expected, $input, $squid, $xffList, $private, $description ) { $_SERVER = $input; $this->setMwGlobals( array( 'wgSquidServersNoPurge' => $squid, @@ -276,7 +276,7 @@ class WebRequestTest extends MediaWikiTestCase { * @expectedException MWException * @covers WebRequest::getIP */ - function testGetIpLackOfRemoteAddrThrowAnException() { + public function testGetIpLackOfRemoteAddrThrowAnException() { $request = new WebRequest(); # Next call throw an exception about lacking an IP $request->getIP(); @@ -302,7 +302,7 @@ class WebRequestTest extends MediaWikiTestCase { * @dataProvider provideLanguageData * @covers WebRequest::getAcceptLang */ - function testAcceptLang( $acceptLanguageHeader, $expectedLanguages, $description ) { + public function testAcceptLang( $acceptLanguageHeader, $expectedLanguages, $description ) { $_SERVER = array( 'HTTP_ACCEPT_LANGUAGE' => $acceptLanguageHeader ); $request = new WebRequest(); $this->assertSame( $request->getAcceptLang(), $expectedLanguages, $description ); diff --git a/tests/phpunit/includes/XmlTest.php b/tests/phpunit/includes/XmlTest.php index a0b33ee801..8205029f54 100644 --- a/tests/phpunit/includes/XmlTest.php +++ b/tests/phpunit/includes/XmlTest.php @@ -57,7 +57,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::element */ - function testElementOpen() { + public function testElementOpen() { $this->assertEquals( '', Xml::element( 'element', null, null ), @@ -68,7 +68,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::element */ - function testElementEmpty() { + public function testElementEmpty() { $this->assertEquals( '', Xml::element( 'element', null, '' ), @@ -79,7 +79,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::input */ - function testElementInputCanHaveAValueOfZero() { + public function testElementInputCanHaveAValueOfZero() { $this->assertEquals( '', Xml::input( 'name', false, 0 ), @@ -90,7 +90,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::element */ - function testElementEscaping() { + public function testElementEscaping() { $this->assertEquals( 'hello <there> you & you', Xml::element( 'element', null, 'hello you & you' ), @@ -110,7 +110,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::element */ - function testElementAttributes() { + public function testElementAttributes() { $this->assertEquals( '="<>">', Xml::element( 'element', array( 'key' => 'value', '<>' => '<>' ), null ), @@ -121,7 +121,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::openElement */ - function testOpenElement() { + public function testOpenElement() { $this->assertEquals( '', Xml::openElement( 'element', array( 'k' => 'v' ) ), @@ -132,7 +132,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::closeElement */ - function testCloseElement() { + public function testCloseElement() { $this->assertEquals( '', Xml::closeElement( 'element' ), 'closeElement() shortcut' ); } @@ -222,7 +222,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::textarea */ - function testTextareaNoContent() { + public function testTextareaNoContent() { $this->assertEquals( '', Xml::textarea( 'name', '' ), @@ -233,7 +233,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::textarea */ - function testTextareaAttribs() { + public function testTextareaAttribs() { $this->assertEquals( '', Xml::textarea( 'name', '', 20, 10 ), @@ -244,7 +244,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::label */ - function testLabelCreation() { + public function testLabelCreation() { $this->assertEquals( '', Xml::label( 'name', 'id' ), @@ -255,7 +255,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::label */ - function testLabelAttributeCanOnlyBeClassOrTitle() { + public function testLabelAttributeCanOnlyBeClassOrTitle() { $this->assertEquals( '', Xml::label( 'name', 'id', array( 'generated' => true ) ), @@ -287,7 +287,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::languageSelector */ - function testLanguageSelector() { + public function testLanguageSelector() { $select = Xml::languageSelector( 'en', true, null, array( 'id' => 'testlang' ), wfMessage( 'yourlanguage' ) ); $this->assertEquals( @@ -299,7 +299,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::escapeJsString */ - function testEscapeJsStringSpecialChars() { + public function testEscapeJsStringSpecialChars() { $this->assertEquals( '\\\\\r\n', Xml::escapeJsString( "\\\r\n" ), @@ -310,7 +310,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::encodeJsVar */ - function testEncodeJsVarBoolean() { + public function testEncodeJsVarBoolean() { $this->assertEquals( 'true', Xml::encodeJsVar( true ), @@ -321,7 +321,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::encodeJsVar */ - function testEncodeJsVarNull() { + public function testEncodeJsVarNull() { $this->assertEquals( 'null', Xml::encodeJsVar( null ), @@ -332,7 +332,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::encodeJsVar */ - function testEncodeJsVarArray() { + public function testEncodeJsVarArray() { $this->assertEquals( '["a",1]', Xml::encodeJsVar( array( 'a', 1 ) ), @@ -348,7 +348,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::encodeJsVar */ - function testEncodeJsVarObject() { + public function testEncodeJsVarObject() { $this->assertEquals( '{"a":"a","b":1}', Xml::encodeJsVar( (object)array( 'a' => 'a', 'b' => 1 ) ), @@ -359,7 +359,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::encodeJsVar */ - function testEncodeJsVarInt() { + public function testEncodeJsVarInt() { $this->assertEquals( '123456', Xml::encodeJsVar( 123456 ), @@ -370,7 +370,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::encodeJsVar */ - function testEncodeJsVarFloat() { + public function testEncodeJsVarFloat() { $this->assertEquals( '1.23456', Xml::encodeJsVar( 1.23456 ), @@ -381,7 +381,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::encodeJsVar */ - function testEncodeJsVarIntString() { + public function testEncodeJsVarIntString() { $this->assertEquals( '"123456"', Xml::encodeJsVar( '123456' ), @@ -392,7 +392,7 @@ class XmlTest extends MediaWikiTestCase { /** * @covers Xml::encodeJsVar */ - function testEncodeJsVarFloatString() { + public function testEncodeJsVarFloatString() { $this->assertEquals( '"1.23456"', Xml::encodeJsVar( '1.23456' ), diff --git a/tests/phpunit/includes/ZipDirectoryReaderTest.php b/tests/phpunit/includes/ZipDirectoryReaderTest.php index 7f436cd082..2627a41727 100644 --- a/tests/phpunit/includes/ZipDirectoryReaderTest.php +++ b/tests/phpunit/includes/ZipDirectoryReaderTest.php @@ -29,21 +29,21 @@ class ZipDirectoryReaderTest extends MediaWikiTestCase { $this->assertTrue( $status->isOK(), $assertMessage ); } - function testEmpty() { + public function testEmpty() { $this->readZipAssertSuccess( 'empty.zip', 'Empty zip' ); } - function testMultiDisk0() { + public function testMultiDisk0() { $this->readZipAssertError( 'split.zip', 'zip-unsupported', 'Split zip error' ); } - function testNoSignature() { + public function testNoSignature() { $this->readZipAssertError( 'nosig.zip', 'zip-wrong-format', 'No signature should give "wrong format" error' ); } - function testSimple() { + public function testSimple() { $this->readZipAssertSuccess( 'class.zip', 'Simple ZIP' ); $this->assertEquals( $this->entries, array( array( 'name' => 'Class.class', @@ -52,33 +52,33 @@ class ZipDirectoryReaderTest extends MediaWikiTestCase { ) ) ); } - function testBadCentralEntrySignature() { + public function testBadCentralEntrySignature() { $this->readZipAssertError( 'wrong-central-entry-sig.zip', 'zip-bad', 'Bad central entry error' ); } - function testTrailingBytes() { + public function testTrailingBytes() { $this->readZipAssertError( 'trail.zip', 'zip-bad', 'Trailing bytes error' ); } - function testWrongCDStart() { + public function testWrongCDStart() { $this->readZipAssertError( 'wrong-cd-start-disk.zip', 'zip-unsupported', 'Wrong CD start disk error' ); } - function testCentralDirectoryGap() { + public function testCentralDirectoryGap() { $this->readZipAssertError( 'cd-gap.zip', 'zip-bad', 'CD gap error' ); } - function testCentralDirectoryTruncated() { + public function testCentralDirectoryTruncated() { $this->readZipAssertError( 'cd-truncated.zip', 'zip-bad', 'CD truncated error (should hit unpack() overrun)' ); } - function testLooksLikeZip64() { + public function testLooksLikeZip64() { $this->readZipAssertError( 'looks-like-zip64.zip', 'zip-unsupported', 'A file which looks like ZIP64 but isn\'t, should give error' ); } diff --git a/tests/phpunit/includes/api/ApiAccountCreationTest.php b/tests/phpunit/includes/api/ApiAccountCreationTest.php index 50638ca716..68f80ac9e8 100644 --- a/tests/phpunit/includes/api/ApiAccountCreationTest.php +++ b/tests/phpunit/includes/api/ApiAccountCreationTest.php @@ -20,7 +20,7 @@ class ApiCreateAccountTest extends ApiTestCase { * a bit slow. Raise the default timeout. * @group medium */ - function testValid() { + public function testValid() { global $wgServer; if ( !isset( $wgServer ) ) { @@ -109,7 +109,7 @@ class ApiCreateAccountTest extends ApiTestCase { * Make sure requests with no names are invalid. * @expectedException UsageException */ - function testNoName() { + public function testNoName() { $this->doApiRequest( array( 'action' => 'createaccount', 'token' => LoginForm::getCreateaccountToken(), @@ -121,7 +121,7 @@ class ApiCreateAccountTest extends ApiTestCase { * Make sure requests with no password are invalid. * @expectedException UsageException */ - function testNoPassword() { + public function testNoPassword() { $this->doApiRequest( array( 'action' => 'createaccount', 'name' => 'testName', @@ -133,7 +133,7 @@ class ApiCreateAccountTest extends ApiTestCase { * Make sure requests with existing users are invalid. * @expectedException UsageException */ - function testExistingUser() { + public function testExistingUser() { $this->doApiRequest( array( 'action' => 'createaccount', 'name' => 'Apitestsysop', @@ -147,7 +147,7 @@ class ApiCreateAccountTest extends ApiTestCase { * Make sure requests with invalid emails are invalid. * @expectedException UsageException */ - function testInvalidEmail() { + public function testInvalidEmail() { $this->doApiRequest( array( 'action' => 'createaccount', 'name' => 'Test User', diff --git a/tests/phpunit/includes/api/ApiBlockTest.php b/tests/phpunit/includes/api/ApiBlockTest.php index d0eb18a287..8afb748a8d 100644 --- a/tests/phpunit/includes/api/ApiBlockTest.php +++ b/tests/phpunit/includes/api/ApiBlockTest.php @@ -34,7 +34,7 @@ class ApiBlockTest extends ApiTestCase { * Which made the Block/Unblock API to actually verify the token * previously always considered valid (bug 34212). */ - function testMakeNormalBlock() { + public function testMakeNormalBlock() { $tokens = $this->getTokens(); $user = User::newFromName( 'UTApiBlockee' ); @@ -70,7 +70,7 @@ class ApiBlockTest extends ApiTestCase { * @dataProvider provideBlockUnblockAction * @expectedException UsageException */ - function testBlockingActionWithNoToken( $action ) { + public function testBlockingActionWithNoToken( $action ) { $this->doApiRequest( array( 'action' => $action, diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php index 3926e85a3a..0c49b12b97 100644 --- a/tests/phpunit/includes/api/ApiEditPageTest.php +++ b/tests/phpunit/includes/api/ApiEditPageTest.php @@ -43,7 +43,7 @@ class ApiEditPageTest extends ApiTestCase { parent::tearDown(); } - function testEdit() { + public function testEdit() { $name = 'Help:ApiEditPageTest_testEdit'; // assume Help namespace to default to wikitext // -- test new page -------------------------------------------- @@ -97,7 +97,7 @@ class ApiEditPageTest extends ApiTestCase { ); } - function testNonTextEdit() { + public function testNonTextEdit() { $name = 'Dummy:ApiEditPageTest_testNonTextEdit'; $data = serialize( 'some bla bla text' ); @@ -150,7 +150,7 @@ class ApiEditPageTest extends ApiTestCase { /** * @dataProvider provideEditAppend */ - function testEditAppend( $text, $op, $append, $expected ) { + public function testEditAppend( $text, $op, $append, $expected ) { static $count = 0; $count++; @@ -196,7 +196,7 @@ class ApiEditPageTest extends ApiTestCase { /** * Test editing of sections */ - function testEditSection() { + public function testEditSection() { $name = 'Help:ApiEditPageTest_testEditSection'; $page = WikiPage::factory( Title::newFromText( $name ) ); $text = "==section 1==\ncontent 1\n==section 2==\ncontent2"; @@ -233,7 +233,7 @@ class ApiEditPageTest extends ApiTestCase { * page that doesn't exist (bug 52830) and one that * does exist */ - function testEditNewSection() { + public function testEditNewSection() { $name = 'Help:ApiEditPageTest_testEditNewSection'; // Test on a page that does not already exist @@ -266,7 +266,7 @@ class ApiEditPageTest extends ApiTestCase { $this->assertEquals( $text, "== header ==\n\ntest\n\n== header ==\n\ntest" ); } - function testEditConflict() { + public function testEditConflict() { static $count = 0; $count++; @@ -302,7 +302,7 @@ class ApiEditPageTest extends ApiTestCase { } } - function testEditConflict_redirect() { + public function testEditConflict_redirect() { static $count = 0; $count++; @@ -358,7 +358,7 @@ class ApiEditPageTest extends ApiTestCase { } } - function testEditConflict_bug41990() { + public function testEditConflict_bug41990() { static $count = 0; $count++; diff --git a/tests/phpunit/includes/api/ApiParseTest.php b/tests/phpunit/includes/api/ApiParseTest.php index b408875c23..2d714e65a2 100644 --- a/tests/phpunit/includes/api/ApiParseTest.php +++ b/tests/phpunit/includes/api/ApiParseTest.php @@ -12,7 +12,7 @@ class ApiParseTest extends ApiTestCase { $this->doLogin(); } - function testParseNonexistentPage() { + public function testParseNonexistentPage() { $somePage = mt_rand(); try { diff --git a/tests/phpunit/includes/api/ApiPurgeTest.php b/tests/phpunit/includes/api/ApiPurgeTest.php index 881eb3f2f2..28b5ff4d4d 100644 --- a/tests/phpunit/includes/api/ApiPurgeTest.php +++ b/tests/phpunit/includes/api/ApiPurgeTest.php @@ -15,7 +15,7 @@ class ApiPurgeTest extends ApiTestCase { /** * @group Broken */ - function testPurgeMainPage() { + public function testPurgeMainPage() { if ( !Title::newFromText( 'UTPage' )->exists() ) { $this->markTestIncomplete( "The article [[UTPage]] does not exist" ); } diff --git a/tests/phpunit/includes/api/ApiTest.php b/tests/phpunit/includes/api/ApiTest.php index 5106be5634..472f8c4a31 100644 --- a/tests/phpunit/includes/api/ApiTest.php +++ b/tests/phpunit/includes/api/ApiTest.php @@ -7,7 +7,7 @@ */ class ApiTest extends ApiTestCase { - function testRequireOnlyOneParameterDefault() { + public function testRequireOnlyOneParameterDefault() { $mock = new MockApi(); $this->assertEquals( @@ -18,7 +18,7 @@ class ApiTest extends ApiTestCase { /** * @expectedException UsageException */ - function testRequireOnlyOneParameterZero() { + public function testRequireOnlyOneParameterZero() { $mock = new MockApi(); $this->assertEquals( @@ -29,7 +29,7 @@ class ApiTest extends ApiTestCase { /** * @expectedException UsageException */ - function testRequireOnlyOneParameterTrue() { + public function testRequireOnlyOneParameterTrue() { $mock = new MockApi(); $this->assertEquals( @@ -43,7 +43,7 @@ class ApiTest extends ApiTestCase { * * @expectedException UsageException */ - function testApi() { + public function testApi() { $api = new ApiMain( new FauxRequest( array( 'action' => 'help', 'format' => 'xml' ) ) ); @@ -61,14 +61,14 @@ class ApiTest extends ApiTestCase { /** * Test result of attempted login with an empty username */ - function testApiLoginNoName() { + public function testApiLoginNoName() { $data = $this->doApiRequest( array( 'action' => 'login', 'lgname' => '', 'lgpassword' => self::$users['sysop']->password, ) ); $this->assertEquals( 'NoName', $data[0]['login']['result'] ); } - function testApiLoginBadPass() { + public function testApiLoginBadPass() { global $wgServer; $user = self::$users['sysop']; @@ -109,7 +109,7 @@ class ApiTest extends ApiTestCase { $this->assertEquals( "WrongPass", $a ); } - function testApiLoginGoodPass() { + public function testApiLoginGoodPass() { global $wgServer; if ( !isset( $wgServer ) ) { @@ -155,7 +155,7 @@ class ApiTest extends ApiTestCase { /** * @group Broken */ - function testApiGotCookie() { + public function testApiGotCookie() { $this->markTestIncomplete( "The server can't do external HTTP requests, and the internal one won't give cookies" ); global $wgServer, $wgScriptPath; @@ -201,7 +201,7 @@ class ApiTest extends ApiTestCase { return $cj; } - function testRunLogin() { + public function testRunLogin() { $sysopUser = self::$users['sysop']; $data = $this->doApiRequest( array( 'action' => 'login', @@ -227,7 +227,7 @@ class ApiTest extends ApiTestCase { return $data; } - function testGettingToken() { + public function testGettingToken() { foreach ( self::$users as $user ) { $this->runTokenTest( $user ); } diff --git a/tests/phpunit/includes/api/ApiUploadTest.php b/tests/phpunit/includes/api/ApiUploadTest.php index ae3a5e94ce..1540af55fb 100644 --- a/tests/phpunit/includes/api/ApiUploadTest.php +++ b/tests/phpunit/includes/api/ApiUploadTest.php @@ -31,7 +31,7 @@ class ApiUploadTest extends ApiTestCaseUpload { * Testing login * XXX this is a funny way of getting session context */ - function testLogin() { + public function testLogin() { $user = self::$users['uploader']; $params = array( diff --git a/tests/phpunit/includes/api/ApiWatchTest.php b/tests/phpunit/includes/api/ApiWatchTest.php index 825398958e..028ea9ffb9 100644 --- a/tests/phpunit/includes/api/ApiWatchTest.php +++ b/tests/phpunit/includes/api/ApiWatchTest.php @@ -18,7 +18,7 @@ class ApiWatchTest extends ApiTestCase { /** */ - function testWatchEdit() { + public function testWatchEdit() { $tokens = $this->getTokens(); $data = $this->doApiRequest( array( @@ -37,7 +37,7 @@ class ApiWatchTest extends ApiTestCase { /** * @depends testWatchEdit */ - function testWatchClear() { + public function testWatchClear() { $tokens = $this->getTokens(); $data = $this->doApiRequest( array( @@ -67,7 +67,7 @@ class ApiWatchTest extends ApiTestCase { /** */ - function testWatchProtect() { + public function testWatchProtect() { $tokens = $this->getTokens(); $data = $this->doApiRequest( array( @@ -85,7 +85,7 @@ class ApiWatchTest extends ApiTestCase { /** */ - function testGetRollbackToken() { + public function testGetRollbackToken() { $this->getTokens(); if ( !Title::newFromText( 'Help:UTPage' )->exists() ) { @@ -121,7 +121,7 @@ class ApiWatchTest extends ApiTestCase { * * @depends testGetRollbackToken */ - function testWatchRollback( $data ) { + public function testWatchRollback( $data ) { $keys = array_keys( $data[0]['query']['pages'] ); $key = array_pop( $keys ); $pageinfo = $data[0]['query']['pages'][$key]; diff --git a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php b/tests/phpunit/includes/api/format/ApiFormatPhpTest.php index 802a0e1f0e..a0bbb2dc7d 100644 --- a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatPhpTest.php @@ -7,7 +7,7 @@ */ class ApiFormatPhpTest extends ApiFormatTestBase { - function testValidPhpSyntax() { + public function testValidPhpSyntax() { $data = $this->apiRequest( 'php', array( 'action' => 'query', 'meta' => 'siteinfo' ) ); diff --git a/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php b/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php index 7f5fe91c3c..1bca2256d0 100644 --- a/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php @@ -10,7 +10,7 @@ class ApiQueryRevisionsTest extends ApiTestCase { /** * @group medium */ - function testContentComesWithContentModelAndFormat() { + public function testContentComesWithContentModelAndFormat() { $pageName = 'Help:' . __METHOD__; $title = Title::newFromText( $pageName ); $page = WikiPage::factory( $title ); diff --git a/tests/phpunit/includes/api/query/ApiQueryTest.php b/tests/phpunit/includes/api/query/ApiQueryTest.php index bc01ec2b0b..f56455553e 100644 --- a/tests/phpunit/includes/api/query/ApiQueryTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryTest.php @@ -12,7 +12,7 @@ class ApiQueryTest extends ApiTestCase { $this->doLogin(); } - function testTitlesGetNormalized() { + public function testTitlesGetNormalized() { global $wgMetaNamespace; @@ -43,7 +43,7 @@ class ApiQueryTest extends ApiTestCase { ); } - function testTitlesAreRejectedIfInvalid() { + public function testTitlesAreRejectedIfInvalid() { $title = false; while ( !$title || Title::newFromText( $title )->exists() ) { $title = md5( mt_rand( 0, 10000 ) + rand( 0, 999000 ) ); diff --git a/tests/phpunit/includes/cache/GenderCacheTest.php b/tests/phpunit/includes/cache/GenderCacheTest.php index 2ac2942f17..ce2db5d77a 100644 --- a/tests/phpunit/includes/cache/GenderCacheTest.php +++ b/tests/phpunit/includes/cache/GenderCacheTest.php @@ -48,7 +48,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { * @dataProvider provideUserGenders * @covers GenderCache::getGenderOf */ - function testUserName( $username, $expectedGender ) { + public function testUserName( $username, $expectedGender ) { $genderCache = GenderCache::singleton(); $gender = $genderCache->getGenderOf( $username ); $this->assertEquals( $gender, $expectedGender, "GenderCache normal" ); @@ -60,7 +60,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { * @dataProvider provideUserGenders * @covers GenderCache::getGenderOf */ - function testUserObjects( $username, $expectedGender ) { + public function testUserObjects( $username, $expectedGender ) { $genderCache = GenderCache::singleton(); $user = User::newFromName( $username ); $gender = $genderCache->getGenderOf( $user ); @@ -86,7 +86,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { * @dataProvider provideStripSubpages * @covers GenderCache::getGenderOf */ - function testStripSubpages( $pageWithSubpage, $expectedGender ) { + public function testStripSubpages( $pageWithSubpage, $expectedGender ) { $genderCache = GenderCache::singleton(); $gender = $genderCache->getGenderOf( $pageWithSubpage ); $this->assertEquals( $gender, $expectedGender, "GenderCache must strip of subpages" ); diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php index 3559f15879..803acf7362 100644 --- a/tests/phpunit/includes/cache/MessageCacheTest.php +++ b/tests/phpunit/includes/cache/MessageCacheTest.php @@ -84,7 +84,7 @@ class MessageCacheTest extends MediaWikiLangTestCase { * * @dataProvider provideMessagesForFallback */ - function testMessageFallbacks( $message, $lang, $expectedContent ) { + public function testMessageFallbacks( $message, $lang, $expectedContent ) { $result = MessageCache::singleton()->get( $message, true, $lang ); $this->assertEquals( $expectedContent, $result, "Message fallback failed." ); } @@ -112,7 +112,7 @@ class MessageCacheTest extends MediaWikiLangTestCase { * * @dataProvider provideMessagesForFullKeys */ - function testFullKeyBehaviour( $message, $lang, $expectedContent ) { + public function testFullKeyBehaviour( $message, $lang, $expectedContent ) { $result = MessageCache::singleton()->get( $message, true, $lang, true ); $this->assertEquals( $expectedContent, $result, "Full key message fallback failed." ); } diff --git a/tests/phpunit/includes/cache/ProcessCacheLRUTest.php b/tests/phpunit/includes/cache/ProcessCacheLRUTest.php index 1c81ea7261..d3793d8343 100644 --- a/tests/phpunit/includes/cache/ProcessCacheLRUTest.php +++ b/tests/phpunit/includes/cache/ProcessCacheLRUTest.php @@ -59,7 +59,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { /** * Highlight diff between assertEquals and assertNotSame */ - function testPhpUnitArrayEquality() { + public function testPhpUnitArrayEquality() { $one = array( 'A' => 1, 'B' => 2 ); $two = array( 'B' => 2, 'A' => 1 ); $this->assertEquals( $one, $two ); // == @@ -70,7 +70,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { * @dataProvider provideInvalidConstructorArg * @expectedException MWException */ - function testConstructorGivenInvalidValue( $maxSize ) { + public function testConstructorGivenInvalidValue( $maxSize ) { new ProcessCacheLRUTestable( $maxSize ); } @@ -88,7 +88,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { ); } - function testAddAndGetAKey() { + public function testAddAndGetAKey() { $oneCache = new ProcessCacheLRUTestable( 1 ); $this->assertCacheEmpty( $oneCache ); @@ -99,7 +99,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { $this->assertEquals( 'value1', $oneCache->get( 'cache-key', 'prop1' ) ); } - function testDeleteOldKey() { + public function testDeleteOldKey() { $oneCache = new ProcessCacheLRUTestable( 1 ); $this->assertCacheEmpty( $oneCache ); @@ -117,7 +117,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { * @param $cacheMaxEntries Maximum entry the created cache will hold * @param $entryToFill Number of entries to insert in the created cache. */ - function testFillingCache( $cacheMaxEntries, $entryToFill, $msg = '' ) { + public function testFillingCache( $cacheMaxEntries, $entryToFill, $msg = '' ) { $cache = new ProcessCacheLRUTestable( $cacheMaxEntries ); $this->fillCache( $cache, $entryToFill ); @@ -145,7 +145,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { * Create a cache with only one remaining entry then update * the first inserted entry. Should bump it to the top. */ - function testReplaceExistingKeyShouldBumpEntryToTop() { + public function testReplaceExistingKeyShouldBumpEntryToTop() { $maxEntries = 3; $cache = new ProcessCacheLRUTestable( $maxEntries ); @@ -164,7 +164,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { ); } - function testRecentlyAccessedKeyStickIn() { + public function testRecentlyAccessedKeyStickIn() { $cache = new ProcessCacheLRUTestable( 2 ); $cache->set( 'first', 'prop1', 'value1' ); $cache->set( 'second', 'prop2', 'value2' ); @@ -183,7 +183,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { * Given a cache having 1,2,3 as key, updating 2 should bump 2 to * the top of the queue with the new value: 1,3,2* (* = updated). */ - function testReplaceExistingKeyInAFullCacheShouldBumpToTop() { + public function testReplaceExistingKeyInAFullCacheShouldBumpToTop() { $maxEntries = 3; $cache = new ProcessCacheLRUTestable( $maxEntries ); @@ -204,7 +204,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { ); } - function testBumpExistingKeyToTop() { + public function testBumpExistingKeyToTop() { $cache = new ProcessCacheLRUTestable( 3 ); $this->fillCache( $cache, 3 ); diff --git a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php index 7d7a2bd823..134f856601 100644 --- a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php +++ b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php @@ -60,7 +60,7 @@ class DatabaseMysqlBaseTest extends MediaWikiTestCase { * @dataProvider provideDiapers * @covers DatabaseMysqlBase::addIdentifierQuotes */ - function testAddIdentifierQuotes( $expected, $in ) { + public function testAddIdentifierQuotes( $expected, $in ) { $db = new FakeDatabaseMysqlBase(); $quoted = $db->addIdentifierQuotes( $in ); $this->assertEquals($expected, $quoted); diff --git a/tests/phpunit/includes/db/DatabaseSQLTest.php b/tests/phpunit/includes/db/DatabaseSQLTest.php index 726d63a2e7..bdd567e7f6 100644 --- a/tests/phpunit/includes/db/DatabaseSQLTest.php +++ b/tests/phpunit/includes/db/DatabaseSQLTest.php @@ -27,7 +27,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideSelect * @covers DatabaseBase::select */ - function testSelect( $sql, $sqlText ) { + public function testSelect( $sql, $sqlText ) { $this->database->select( $sql['tables'], $sql['fields'], @@ -129,7 +129,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideUpdate * @covers DatabaseBase::update */ - function testUpdate( $sql, $sqlText ) { + public function testUpdate( $sql, $sqlText ) { $this->database->update( $sql['table'], $sql['values'], @@ -181,7 +181,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideDelete * @covers DatabaseBase::delete */ - function testDelete( $sql, $sqlText ) { + public function testDelete( $sql, $sqlText ) { $this->database->delete( $sql['table'], $sql['conds'], @@ -214,7 +214,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideUpsert * @covers DatabaseBase::upsert */ - function testUpsert( $sql, $sqlText ) { + public function testUpsert( $sql, $sqlText ) { $this->database->upsert( $sql['table'], $sql['rows'], @@ -250,7 +250,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideDeleteJoin * @covers DatabaseBase::deleteJoin */ - function testDeleteJoin( $sql, $sqlText ) { + public function testDeleteJoin( $sql, $sqlText ) { $this->database->deleteJoin( $sql['delTable'], $sql['joinTable'], @@ -297,7 +297,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideInsert * @covers DatabaseBase::insert */ - function testInsert( $sql, $sqlText ) { + public function testInsert( $sql, $sqlText ) { $this->database->insert( $sql['table'], $sql['rows'], @@ -350,7 +350,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideInsertSelect * @covers DatabaseBase::insertSelect */ - function testInsertSelect( $sql, $sqlText ) { + public function testInsertSelect( $sql, $sqlText ) { $this->database->insertSelect( $sql['destTable'], $sql['srcTable'], @@ -413,7 +413,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideReplace * @covers DatabaseBase::replace */ - function testReplace( $sql, $sqlText ) { + public function testReplace( $sql, $sqlText ) { $this->database->replace( $sql['table'], $sql['uniqueIndexes'], @@ -528,7 +528,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideNativeReplace * @covers DatabaseBase::nativeReplace */ - function testNativeReplace( $sql, $sqlText ) { + public function testNativeReplace( $sql, $sqlText ) { $this->database->nativeReplace( $sql['table'], $sql['rows'], @@ -555,7 +555,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideConditional * @covers DatabaseBase::conditional */ - function testConditional( $sql, $sqlText ) { + public function testConditional( $sql, $sqlText ) { $this->assertEquals( trim( $this->database->conditional( $sql['conds'], $sql['true'], @@ -596,7 +596,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideBuildConcat * @covers DatabaseBase::buildConcat */ - function testBuildConcat( $stringList, $sqlText ) { + public function testBuildConcat( $stringList, $sqlText ) { $this->assertEquals( trim( $this->database->buildConcat( $stringList ) ), $sqlText ); @@ -619,7 +619,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideBuildLike * @covers DatabaseBase::buildLike */ - function testBuildLike( $array, $sqlText ) { + public function testBuildLike( $array, $sqlText ) { $this->assertEquals( trim( $this->database->buildLike( $array ) ), $sqlText ); @@ -650,7 +650,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { * @dataProvider provideUnionQueries * @covers DatabaseBase::unionQueries */ - function testUnionQueries( $sql, $sqlText ) { + public function testUnionQueries( $sql, $sqlText ) { $this->assertEquals( trim( $this->database->unionQueries( $sql['sqls'], $sql['all'] @@ -686,7 +686,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @covers DatabaseBase::commit */ - function testTransactionCommit() { + public function testTransactionCommit() { $this->database->begin( __METHOD__ ); $this->database->commit( __METHOD__ ); $this->assertLastSql( 'BEGIN; COMMIT' ); @@ -695,7 +695,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @covers DatabaseBase::rollback */ - function testTransactionRollback() { + public function testTransactionRollback() { $this->database->begin( __METHOD__ ); $this->database->rollback( __METHOD__ ); $this->assertLastSql( 'BEGIN; ROLLBACK' ); @@ -704,7 +704,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @covers DatabaseBase::dropTable */ - function testDropTable() { + public function testDropTable() { $this->database->setExistingTables( array( 'table' ) ); $this->database->dropTable( 'table', __METHOD__ ); $this->assertLastSql( 'DROP TABLE table' ); @@ -713,7 +713,7 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @covers DatabaseBase::dropTable */ - function testDropNonExistingTable() { + public function testDropNonExistingTable() { $this->assertFalse( $this->database->dropTable( 'non_existing', __METHOD__ ) ); diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php index f151fb26a2..70ee9465c3 100644 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/includes/db/DatabaseSqliteTest.php @@ -411,7 +411,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase { return $indexes; } - function testCaseInsensitiveLike() { + public function testCaseInsensitiveLike() { // TODO: Test this for all databases $db = new DatabaseSqliteStandalone( ':memory:' ); $res = $db->query( 'SELECT "a" LIKE "A" AS a' ); diff --git a/tests/phpunit/includes/db/DatabaseTest.php b/tests/phpunit/includes/db/DatabaseTest.php index 5e8e7a4eda..301fc99007 100644 --- a/tests/phpunit/includes/db/DatabaseTest.php +++ b/tests/phpunit/includes/db/DatabaseTest.php @@ -26,7 +26,7 @@ class DatabaseTest extends MediaWikiTestCase { /** * @covers DatabaseBase::dropTable */ - function testAddQuotesNull() { + public function testAddQuotesNull() { $check = "NULL"; if ( $this->db->getType() === 'sqlite' || $this->db->getType() === 'oracle' ) { $check = "''"; @@ -34,7 +34,7 @@ class DatabaseTest extends MediaWikiTestCase { $this->assertEquals( $check, $this->db->addQuotes( null ) ); } - function testAddQuotesInt() { + public function testAddQuotesInt() { # returning just "1234" should be ok too, though... # maybe $this->assertEquals( @@ -42,20 +42,20 @@ class DatabaseTest extends MediaWikiTestCase { $this->db->addQuotes( 1234 ) ); } - function testAddQuotesFloat() { + public function testAddQuotesFloat() { # returning just "1234.5678" would be ok too, though $this->assertEquals( "'1234.5678'", $this->db->addQuotes( 1234.5678 ) ); } - function testAddQuotesString() { + public function testAddQuotesString() { $this->assertEquals( "'string'", $this->db->addQuotes( 'string' ) ); } - function testAddQuotesStringQuote() { + public function testAddQuotesStringQuote() { $check = "'string''s cause trouble'"; if ( $this->db->getType() === 'mysql' ) { $check = "'string\'s cause trouble'"; @@ -115,21 +115,21 @@ class DatabaseTest extends MediaWikiTestCase { } } - function testTableNameLocal() { + public function testTableNameLocal() { $this->assertEquals( $this->prefixAndQuote( 'tablename' ), $this->db->tableName( 'tablename' ) ); } - function testTableNameRawLocal() { + public function testTableNameRawLocal() { $this->assertEquals( $this->prefixAndQuote( 'tablename', null, null, 'raw' ), $this->db->tableName( 'tablename', 'raw' ) ); } - function testTableNameShared() { + public function testTableNameShared() { $this->assertEquals( $this->prefixAndQuote( 'tablename', 'sharedatabase', 'sh_' ), $this->getSharedTableName( 'tablename', 'sharedatabase', 'sh_' ) @@ -141,7 +141,7 @@ class DatabaseTest extends MediaWikiTestCase { ); } - function testTableNameRawShared() { + public function testTableNameRawShared() { $this->assertEquals( $this->prefixAndQuote( 'tablename', 'sharedatabase', 'sh_', 'raw' ), $this->getSharedTableName( 'tablename', 'sharedatabase', 'sh_', 'raw' ) @@ -153,21 +153,21 @@ class DatabaseTest extends MediaWikiTestCase { ); } - function testTableNameForeign() { + public function testTableNameForeign() { $this->assertEquals( $this->prefixAndQuote( 'tablename', 'databasename', '' ), $this->db->tableName( 'databasename.tablename' ) ); } - function testTableNameRawForeign() { + public function testTableNameRawForeign() { $this->assertEquals( $this->prefixAndQuote( 'tablename', 'databasename', '', 'raw' ), $this->db->tableName( 'databasename.tablename', 'raw' ) ); } - function testFillPreparedEmpty() { + public function testFillPreparedEmpty() { $sql = $this->db->fillPrepared( 'SELECT * FROM interwiki', array() ); $this->assertEquals( @@ -175,7 +175,7 @@ class DatabaseTest extends MediaWikiTestCase { $sql ); } - function testFillPreparedQuestion() { + public function testFillPreparedQuestion() { $sql = $this->db->fillPrepared( 'SELECT * FROM cur WHERE cur_namespace=? AND cur_title=?', array( 4, "Snicker's_paradox" ) ); @@ -187,7 +187,7 @@ class DatabaseTest extends MediaWikiTestCase { $this->assertEquals( $check, $sql ); } - function testFillPreparedBang() { + public function testFillPreparedBang() { $sql = $this->db->fillPrepared( 'SELECT user_id FROM ! WHERE user_name=?', array( '"user"', "Slash's Dot" ) ); @@ -199,7 +199,7 @@ class DatabaseTest extends MediaWikiTestCase { $this->assertEquals( $check, $sql ); } - function testFillPreparedRaw() { + public function testFillPreparedRaw() { $sql = $this->db->fillPrepared( "SELECT * FROM cur WHERE cur_title='This_\\&_that,_WTF\\?\\!'", array( '"user"', "Slash's Dot" ) ); @@ -208,7 +208,7 @@ class DatabaseTest extends MediaWikiTestCase { $sql ); } - function testStoredFunctions() { + public function testStoredFunctions() { if ( !in_array( wfGetDB( DB_MASTER )->getType(), array( 'mysql', 'postgres' ) ) ) { $this->markTestSkipped( 'MySQL or Postgres required' ); } @@ -226,7 +226,7 @@ class DatabaseTest extends MediaWikiTestCase { ); } - function testUnknownTableCorruptsResults() { + public function testUnknownTableCorruptsResults() { $res = $this->db->select( 'page', '*', array( 'page_id' => 1 ) ); $this->assertFalse( $this->db->tableExists( 'foobarbaz' ) ); $this->assertInternalType( 'int', $res->numRows() ); diff --git a/tests/phpunit/includes/debug/MWDebugTest.php b/tests/phpunit/includes/debug/MWDebugTest.php index 9026cb90d6..6926b1c835 100644 --- a/tests/phpunit/includes/debug/MWDebugTest.php +++ b/tests/phpunit/includes/debug/MWDebugTest.php @@ -21,7 +21,7 @@ class MWDebugTest extends MediaWikiTestCase { parent::tearDown(); } - function testAddLog() { + public function testAddLog() { MWDebug::log( 'logging a string' ); $this->assertEquals( array( array( @@ -33,7 +33,7 @@ class MWDebugTest extends MediaWikiTestCase { ); } - function testAddWarning() { + public function testAddWarning() { MWDebug::warning( 'Warning message' ); $this->assertEquals( array( array( @@ -45,7 +45,7 @@ class MWDebugTest extends MediaWikiTestCase { ); } - function testAvoidDuplicateDeprecations() { + public function testAvoidDuplicateDeprecations() { MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); @@ -56,7 +56,7 @@ class MWDebugTest extends MediaWikiTestCase { ); } - function testAvoidNonConsecutivesDuplicateDeprecations() { + public function testAvoidNonConsecutivesDuplicateDeprecations() { MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); MWDebug::warning( 'some warning' ); MWDebug::log( 'we could have logged something too' ); diff --git a/tests/phpunit/includes/filerepo/FileRepoTest.php b/tests/phpunit/includes/filerepo/FileRepoTest.php index b760e26b69..e3a755673d 100644 --- a/tests/phpunit/includes/filerepo/FileRepoTest.php +++ b/tests/phpunit/includes/filerepo/FileRepoTest.php @@ -6,7 +6,7 @@ class FileRepoTest extends MediaWikiTestCase { * @expectedException MWException * @covers FileRepo::__construct */ - function testFileRepoConstructionOptionCanNotBeNull() { + public function testFileRepoConstructionOptionCanNotBeNull() { new FileRepo(); } @@ -14,7 +14,7 @@ class FileRepoTest extends MediaWikiTestCase { * @expectedException MWException * @covers FileRepo::__construct */ - function testFileRepoConstructionOptionCanNotBeAnEmptyArray() { + public function testFileRepoConstructionOptionCanNotBeAnEmptyArray() { new FileRepo( array() ); } @@ -22,7 +22,7 @@ class FileRepoTest extends MediaWikiTestCase { * @expectedException MWException * @covers FileRepo::__construct */ - function testFileRepoConstructionOptionNeedNameKey() { + public function testFileRepoConstructionOptionNeedNameKey() { new FileRepo( array( 'backend' => 'foobar' ) ); @@ -32,7 +32,7 @@ class FileRepoTest extends MediaWikiTestCase { * @expectedException MWException * @covers FileRepo::__construct */ - function testFileRepoConstructionOptionNeedBackendKey() { + public function testFileRepoConstructionOptionNeedBackendKey() { new FileRepo( array( 'name' => 'foobar' ) ); @@ -41,7 +41,7 @@ class FileRepoTest extends MediaWikiTestCase { /** * @covers FileRepo::__construct */ - function testFileRepoConstructionWithRequiredOptions() { + public function testFileRepoConstructionWithRequiredOptions() { $f = new FileRepo( array( 'name' => 'FileRepoTestRepository', 'backend' => new FSFileBackend( array( diff --git a/tests/phpunit/includes/installer/InstallDocFormatterTest.php b/tests/phpunit/includes/installer/InstallDocFormatterTest.php index ea87ede195..0e5f2671bd 100644 --- a/tests/phpunit/includes/installer/InstallDocFormatterTest.php +++ b/tests/phpunit/includes/installer/InstallDocFormatterTest.php @@ -9,7 +9,7 @@ class InstallDocFormatterTest extends MediaWikiTestCase { * @covers InstallDocFormatter::format * @dataProvider provideDocFormattingTests */ - function testFormat( $expected, $unformattedText, $message = '' ) { + public function testFormat( $expected, $unformattedText, $message = '' ) { $this->assertEquals( $expected, InstallDocFormatter::format( $unformattedText ), diff --git a/tests/phpunit/includes/installer/OracleInstallerTest.php b/tests/phpunit/includes/installer/OracleInstallerTest.php index 592500d7b2..66e655925b 100644 --- a/tests/phpunit/includes/installer/OracleInstallerTest.php +++ b/tests/phpunit/includes/installer/OracleInstallerTest.php @@ -13,7 +13,7 @@ class OracleInstallerTest extends MediaWikiTestCase { * @dataProvider provideOracleConnectStrings * @covers OracleInstaller::checkConnectStringFormat */ - function testCheckConnectStringFormat( $expected, $connectString, $msg = '' ) { + public function testCheckConnectStringFormat( $expected, $connectString, $msg = '' ) { $validity = $expected ? 'should be valid' : 'should NOT be valid'; $msg = "'$connectString' ($msg) $validity."; $this->assertEquals( $expected, diff --git a/tests/phpunit/includes/jobqueue/JobQueueTest.php b/tests/phpunit/includes/jobqueue/JobQueueTest.php index 699015314f..4e51c4fc16 100644 --- a/tests/phpunit/includes/jobqueue/JobQueueTest.php +++ b/tests/phpunit/includes/jobqueue/JobQueueTest.php @@ -71,7 +71,7 @@ class JobQueueTest extends MediaWikiTestCase { /** * @dataProvider provider_queueLists */ - function testProperties( $queue, $recycles, $desc ) { + public function testProperties( $queue, $recycles, $desc ) { $queue = $this->$queue; if ( !$queue ) { $this->markTestSkipped( $desc ); @@ -84,7 +84,7 @@ class JobQueueTest extends MediaWikiTestCase { /** * @dataProvider provider_queueLists */ - function testBasicOperations( $queue, $recycles, $desc ) { + public function testBasicOperations( $queue, $recycles, $desc ) { $queue = $this->$queue; if ( !$queue ) { $this->markTestSkipped( $desc ); @@ -158,7 +158,7 @@ class JobQueueTest extends MediaWikiTestCase { /** * @dataProvider provider_queueLists */ - function testBasicDeduplication( $queue, $recycles, $desc ) { + public function testBasicDeduplication( $queue, $recycles, $desc ) { $queue = $this->$queue; if ( !$queue ) { $this->markTestSkipped( $desc ); @@ -215,7 +215,7 @@ class JobQueueTest extends MediaWikiTestCase { /** * @dataProvider provider_queueLists */ - function testRootDeduplication( $queue, $recycles, $desc ) { + public function testRootDeduplication( $queue, $recycles, $desc ) { $queue = $this->$queue; if ( !$queue ) { $this->markTestSkipped( $desc ); @@ -268,7 +268,7 @@ class JobQueueTest extends MediaWikiTestCase { /** * @dataProvider provider_fifoQueueLists */ - function testJobOrder( $queue, $recycles, $desc ) { + public function testJobOrder( $queue, $recycles, $desc ) { $queue = $this->$queue; if ( !$queue ) { $this->markTestSkipped( $desc ); diff --git a/tests/phpunit/includes/libs/CSSMinTest.php b/tests/phpunit/includes/libs/CSSMinTest.php index e9901ce24d..951dd7b962 100644 --- a/tests/phpunit/includes/libs/CSSMinTest.php +++ b/tests/phpunit/includes/libs/CSSMinTest.php @@ -21,7 +21,7 @@ class CSSMinTest extends MediaWikiTestCase { /** * @dataProvider provideMinifyCases */ - function testMinify( $code, $expectedOutput ) { + public function testMinify( $code, $expectedOutput ) { $minified = CSSMin::minify( $code ); $this->assertEquals( $expectedOutput, $minified, 'Minified output should be in the form expected.' ); @@ -70,7 +70,7 @@ class CSSMinTest extends MediaWikiTestCase { /** * @dataProvider provideRemapCases */ - function testRemap( $message, $params, $expectedOutput ) { + public function testRemap( $message, $params, $expectedOutput ) { $remapped = call_user_func_array( 'CSSMin::remap', $params ); $messageAdd = " Case: $message"; @@ -115,7 +115,7 @@ class CSSMinTest extends MediaWikiTestCase { * @group Broken * @dataProvider provideStringCases */ - function testMinifyWithCSSStringValues( $code, $expectedOutput ) { + public function testMinifyWithCSSStringValues( $code, $expectedOutput ) { $this->testMinifyOutput( $code, $expectedOutput ); } diff --git a/tests/phpunit/includes/libs/IEUrlExtensionTest.php b/tests/phpunit/includes/libs/IEUrlExtensionTest.php index d04dd7d4df..66fe915afb 100644 --- a/tests/phpunit/includes/libs/IEUrlExtensionTest.php +++ b/tests/phpunit/includes/libs/IEUrlExtensionTest.php @@ -4,7 +4,7 @@ * Tests for IEUrlExtension::findIE6Extension */ class IEUrlExtensionTest extends MediaWikiTestCase { - function testSimple() { + public function testSimple() { $this->assertEquals( 'y', IEUrlExtension::findIE6Extension( 'x.y' ), @@ -12,7 +12,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testSimpleNoExt() { + public function testSimpleNoExt() { $this->assertEquals( '', IEUrlExtension::findIE6Extension( 'x' ), @@ -20,7 +20,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testEmpty() { + public function testEmpty() { $this->assertEquals( '', IEUrlExtension::findIE6Extension( '' ), @@ -28,7 +28,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testQuestionMark() { + public function testQuestionMark() { $this->assertEquals( '', IEUrlExtension::findIE6Extension( '?' ), @@ -36,7 +36,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testExtQuestionMark() { + public function testExtQuestionMark() { $this->assertEquals( 'x', IEUrlExtension::findIE6Extension( '.x?' ), @@ -44,7 +44,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testQuestionMarkExt() { + public function testQuestionMarkExt() { $this->assertEquals( 'x', IEUrlExtension::findIE6Extension( '?.x' ), @@ -52,7 +52,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testInvalidChar() { + public function testInvalidChar() { $this->assertEquals( '', IEUrlExtension::findIE6Extension( '.x*' ), @@ -60,7 +60,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testInvalidCharThenExtension() { + public function testInvalidCharThenExtension() { $this->assertEquals( 'x', IEUrlExtension::findIE6Extension( '*.x' ), @@ -68,7 +68,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testMultipleQuestionMarks() { + public function testMultipleQuestionMarks() { $this->assertEquals( 'c', IEUrlExtension::findIE6Extension( 'a?b?.c?.d?e?f' ), @@ -76,7 +76,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testExeException() { + public function testExeException() { $this->assertEquals( 'd', IEUrlExtension::findIE6Extension( 'a?b?.exe?.d?.e' ), @@ -84,7 +84,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testExeException2() { + public function testExeException2() { $this->assertEquals( 'exe', IEUrlExtension::findIE6Extension( 'a?b?.exe' ), @@ -92,7 +92,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testHash() { + public function testHash() { $this->assertEquals( '', IEUrlExtension::findIE6Extension( 'a#b.c' ), @@ -100,7 +100,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testHash2() { + public function testHash2() { $this->assertEquals( '', IEUrlExtension::findIE6Extension( 'a?#b.c' ), @@ -108,7 +108,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testDotAtEnd() { + public function testDotAtEnd() { $this->assertEquals( '', IEUrlExtension::findIE6Extension( '.' ), @@ -116,7 +116,7 @@ class IEUrlExtensionTest extends MediaWikiTestCase { ); } - function testTwoDots() { + public function testTwoDots() { $this->assertEquals( 'z', IEUrlExtension::findIE6Extension( 'x.y.z' ), diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php index eb64a6446b..ab72e3619f 100644 --- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php +++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php @@ -119,7 +119,7 @@ class JavaScriptMinifierTest extends MediaWikiTestCase { /** * @dataProvider provideCases */ - function testJavaScriptMinifierOutput( $code, $expectedOutput ) { + public function testJavaScriptMinifierOutput( $code, $expectedOutput ) { $minified = JavaScriptMinifier::minify( $code ); // JSMin+'s parser will throw an exception if output is not valid JS. @@ -153,7 +153,7 @@ class JavaScriptMinifierTest extends MediaWikiTestCase { /** * @dataProvider provideBug32548 */ - function testBug32548Exponent( $num ) { + public function testBug32548Exponent( $num ) { // Long line breaking was being incorrectly done between the base and // exponent part of a number, causing a syntax error. The line should // instead break at the start of the number. diff --git a/tests/phpunit/includes/normal/CleanUpTest.php b/tests/phpunit/includes/normal/CleanUpTest.php index 68efd8607b..52dd2ef546 100644 --- a/tests/phpunit/includes/normal/CleanUpTest.php +++ b/tests/phpunit/includes/normal/CleanUpTest.php @@ -37,13 +37,13 @@ */ class CleanUpTest extends MediaWikiTestCase { /** @todo document */ - function testAscii() { + public function testAscii() { $text = 'This is plain ASCII text.'; $this->assertEquals( $text, UtfNormal::cleanUp( $text ) ); } /** @todo document */ - function testNull() { + public function testNull() { $text = "a \x00 null"; $expect = "a \xef\xbf\xbd null"; $this->assertEquals( @@ -52,13 +52,13 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testLatin() { + public function testLatin() { $text = "L'\xc3\xa9cole"; $this->assertEquals( $text, UtfNormal::cleanUp( $text ) ); } /** @todo document */ - function testLatinNormal() { + public function testLatinNormal() { $text = "L'e\xcc\x81cole"; $expect = "L'\xc3\xa9cole"; $this->assertEquals( $expect, UtfNormal::cleanUp( $text ) ); @@ -105,7 +105,7 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testAllBytes() { + public function testAllBytes() { $this->doTestBytes( '', '' ); $this->doTestBytes( 'x', '' ); $this->doTestBytes( '', 'x' ); @@ -145,7 +145,7 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testDoubleBytes() { + public function testDoubleBytes() { $this->doTestDoubleBytes( '', '' ); $this->doTestDoubleBytes( 'x', '' ); $this->doTestDoubleBytes( '', 'x' ); @@ -198,7 +198,7 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testTripleBytes() { + public function testTripleBytes() { $this->doTestTripleBytes( '', '' ); $this->doTestTripleBytes( 'x', '' ); $this->doTestTripleBytes( '', 'x' ); @@ -276,7 +276,7 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testChunkRegression() { + public function testChunkRegression() { # Check for regression against a chunking bug $text = "\x46\x55\xb8" . "\xdc\x96" . @@ -299,7 +299,7 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testInterposeRegression() { + public function testInterposeRegression() { $text = "\x4e\x30" . "\xb1" . # bad tail "\x3a" . @@ -334,7 +334,7 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testOverlongRegression() { + public function testOverlongRegression() { $text = "\x67" . "\x1a" . # forbidden ascii "\xea" . # bad head @@ -359,7 +359,7 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testSurrogateRegression() { + public function testSurrogateRegression() { $text = "\xed\xb4\x96" . # surrogate 0xDD16 "\x83" . # bad tail "\xb4" . # bad tail @@ -374,7 +374,7 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testBomRegression() { + public function testBomRegression() { $text = "\xef\xbf\xbe" . # U+FFFE, illegal char "\xb2" . # bad tail "\xef" . # bad head @@ -389,7 +389,7 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testForbiddenRegression() { + public function testForbiddenRegression() { $text = "\xef\xbf\xbf"; # U+FFFF, illegal char $expect = "\xef\xbf\xbd"; $this->assertEquals( @@ -398,7 +398,7 @@ class CleanUpTest extends MediaWikiTestCase { } /** @todo document */ - function testHangulRegression() { + public function testHangulRegression() { $text = "\xed\x9c\xaf" . # Hangul char "\xe1\x87\x81"; # followed by another final jamo $expect = $text; # Should *not* change. diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index e90c63041c..43d2c9d40e 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -672,7 +672,7 @@ class NewParserTest extends MediaWikiTestCase { * * @group ParserFuzz */ - function testFuzzTests() { + public function testFuzzTests() { global $wgParserTestFiles; $files = $wgParserTestFiles; diff --git a/tests/phpunit/includes/parser/PreprocessorTest.php b/tests/phpunit/includes/parser/PreprocessorTest.php index 0d2e07e89e..8aee937c92 100644 --- a/tests/phpunit/includes/parser/PreprocessorTest.php +++ b/tests/phpunit/includes/parser/PreprocessorTest.php @@ -233,7 +233,7 @@ class PreprocessorTest extends MediaWikiTestCase { * @dataProvider provideHeadings * @covers Preprocessor_DOM::preprocessToXml */ - function testHeadings( $wikiText, $expectedXml ) { + public function testHeadings( $wikiText, $expectedXml ) { $this->assertEquals( $this->normalizeXml( $expectedXml ), $this->preprocessToXml( $wikiText ) ); } } diff --git a/tests/phpunit/includes/parser/TagHooksTest.php b/tests/phpunit/includes/parser/TagHooksTest.php index ed600790e9..61cbe45daa 100644 --- a/tests/phpunit/includes/parser/TagHooksTest.php +++ b/tests/phpunit/includes/parser/TagHooksTest.php @@ -21,7 +21,7 @@ class TagHookTest extends MediaWikiTestCase { /** * @dataProvider provideValidNames */ - function testTagHooks( $tag ) { + public function testTagHooks( $tag ) { global $wgParserConf, $wgContLang; $parser = new Parser( $wgParserConf ); @@ -36,7 +36,7 @@ class TagHookTest extends MediaWikiTestCase { * @dataProvider provideBadNames * @expectedException MWException */ - function testBadTagHooks( $tag ) { + public function testBadTagHooks( $tag ) { global $wgParserConf, $wgContLang; $parser = new Parser( $wgParserConf ); @@ -48,7 +48,7 @@ class TagHookTest extends MediaWikiTestCase { /** * @dataProvider provideValidNames */ - function testFunctionTagHooks( $tag ) { + public function testFunctionTagHooks( $tag ) { global $wgParserConf, $wgContLang; $parser = new Parser( $wgParserConf ); @@ -63,7 +63,7 @@ class TagHookTest extends MediaWikiTestCase { * @dataProvider provideBadNames * @expectedException MWException */ - function testBadFunctionTagHooks( $tag ) { + public function testBadFunctionTagHooks( $tag ) { global $wgParserConf, $wgContLang; $parser = new Parser( $wgParserConf ); diff --git a/tests/phpunit/includes/search/SearchEngineTest.php b/tests/phpunit/includes/search/SearchEngineTest.php index 8957a2f38e..8706703834 100644 --- a/tests/phpunit/includes/search/SearchEngineTest.php +++ b/tests/phpunit/includes/search/SearchEngineTest.php @@ -115,7 +115,7 @@ class SearchEngineTest extends MediaWikiLangTestCase { return true; } - function testFullWidth() { + public function testFullWidth() { $this->assertEquals( array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ), $this->fetchIds( $this->search->searchText( 'AZ' ) ), @@ -134,14 +134,14 @@ class SearchEngineTest extends MediaWikiLangTestCase { "Search for normalized from Full-width Lower" ); } - function testTextSearch() { + public function testTextSearch() { $this->assertEquals( array( 'Smithee' ), $this->fetchIds( $this->search->searchText( 'smithee' ) ), "Plain search failed" ); } - function testTextPowerSearch() { + public function testTextPowerSearch() { $this->search->setNamespaces( array( 0, 1, 4 ) ); $this->assertEquals( array( @@ -152,7 +152,7 @@ class SearchEngineTest extends MediaWikiLangTestCase { "Power search failed" ); } - function testTitleSearch() { + public function testTitleSearch() { $this->assertEquals( array( 'Alan Smithee', @@ -162,7 +162,7 @@ class SearchEngineTest extends MediaWikiLangTestCase { "Title search failed" ); } - function testTextTitlePowerSearch() { + public function testTextTitlePowerSearch() { $this->search->setNamespaces( array( 0, 1, 4 ) ); $this->assertEquals( array( diff --git a/tests/phpunit/includes/search/SearchUpdateTest.php b/tests/phpunit/includes/search/SearchUpdateTest.php index e947c346d4..2f4fd501b1 100644 --- a/tests/phpunit/includes/search/SearchUpdateTest.php +++ b/tests/phpunit/includes/search/SearchUpdateTest.php @@ -30,7 +30,7 @@ class SearchUpdateTest extends MediaWikiTestCase { return trim( SearchUpdate::updateText( $text ) ); } - function testUpdateText() { + public function testUpdateText() { $this->assertEquals( 'test', $this->updateText( '
TeSt
' ), @@ -62,7 +62,7 @@ EOT ); } - function testBug32712() { + public function testBug32712() { $text = "text „http://example.com“ text"; $result = $this->updateText( $text ); $processed = preg_replace( '/Q/u', 'Q', $result ); diff --git a/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php b/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php index 3b82e07d06..a806b4ac72 100644 --- a/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php +++ b/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php @@ -51,7 +51,7 @@ class QueryAllSpecialPagesTest extends MediaWikiTestCase { * Test SQL for each of our QueryPages objects * @group Database */ - function testQuerypageSqlQuery() { + public function testQuerypageSqlQuery() { global $wgDBtype; foreach ( $this->queryPages as $page ) { diff --git a/tests/phpunit/includes/specials/SpecialPreferencesTest.php b/tests/phpunit/includes/specials/SpecialPreferencesTest.php index c7a48282ec..6c637c6510 100644 --- a/tests/phpunit/includes/specials/SpecialPreferencesTest.php +++ b/tests/phpunit/includes/specials/SpecialPreferencesTest.php @@ -15,7 +15,7 @@ class SpecialPreferencesTest extends MediaWikiTestCase { * * Test specifications by Alexandre "ialex" Emsenhuber. */ - function testBug41337() { + public function testBug41337() { // Set a low limit $this->setMwGlobals( 'wgMaxSigChars', 2 ); diff --git a/tests/phpunit/includes/specials/SpecialSearchTest.php b/tests/phpunit/includes/specials/SpecialSearchTest.php index c737f0524d..17e883fd79 100644 --- a/tests/phpunit/includes/specials/SpecialSearchTest.php +++ b/tests/phpunit/includes/specials/SpecialSearchTest.php @@ -18,7 +18,7 @@ class SpecialSearchTest extends MediaWikiTestCase { * @param $expectedProfile An expected search profile name * @param $expectedNs Array Expected namespaces */ - function testProfileAndNamespaceLoading( + public function testProfileAndNamespaceLoading( $requested, $userOptions, $expectedProfile, $expectedNS, $message = 'Profile name and namespaces mismatches!' ) { @@ -112,7 +112,7 @@ class SpecialSearchTest extends MediaWikiTestCase { * Verify we do not expand search term in on search result page * https://gerrit.wikimedia.org/r/4841 */ - function testSearchTermIsNotExpanded() { + public function testSearchTermIsNotExpanded() { # Initialize [[Special::Search]] $search = new SpecialSearch(); -- 2.20.1