Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F584986
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
37 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/tests/phpunit/includes/Html/HtmlTest.php b/tests/phpunit/includes/Html/HtmlTest.php
index 0deb3d611e8..6fa9063141a 100644
--- a/tests/phpunit/includes/Html/HtmlTest.php
+++ b/tests/phpunit/includes/Html/HtmlTest.php
@@ -110,7 +110,7 @@ class HtmlTest extends MediaWikiIntegrationTestCase {
);
}
- public function dataXmlMimeType() {
+ public function provideXmlMimeType() {
return [
// ( $mimetype, $isXmlMimeType )
# HTML is not an XML MimeType
@@ -129,7 +129,7 @@ class HtmlTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider dataXmlMimeType
+ * @dataProvider provideXmlMimeType
*/
public function testXmlMimeType( $mimetype, $isXmlMimeType ) {
$this->assertEquals( $isXmlMimeType, Html::isXmlMimeType( $mimetype ) );
diff --git a/tests/phpunit/includes/api/ApiOptionsTest.php b/tests/phpunit/includes/api/ApiOptionsTest.php
index 3ca600c0d5a..511b462d7e1 100644
--- a/tests/phpunit/includes/api/ApiOptionsTest.php
+++ b/tests/phpunit/includes/api/ApiOptionsTest.php
@@ -255,7 +255,7 @@ class ApiOptionsTest extends ApiTestCase {
$this->fail( "ApiUsageException was not thrown" );
}
- public function userScenarios() {
+ public function provideUserScenarios() {
return [
[ true, true, false ],
[ true, false, true ],
@@ -263,7 +263,7 @@ class ApiOptionsTest extends ApiTestCase {
}
/**
- * @dataProvider userScenarios
+ * @dataProvider provideUserScenarios
*/
public function testReset( $isRegistered, $isNamed, $expectException ) {
$this->mUserMock->method( 'isRegistered' )->willReturn( $isRegistered );
@@ -296,7 +296,7 @@ class ApiOptionsTest extends ApiTestCase {
}
/**
- * @dataProvider userScenarios
+ * @dataProvider provideUserScenarios
*/
public function testResetKinds( $isRegistered, $isNamed, $expectException ) {
$this->mUserMock->method( 'isRegistered' )->willReturn( $isRegistered );
@@ -328,7 +328,7 @@ class ApiOptionsTest extends ApiTestCase {
}
/**
- * @dataProvider userScenarios
+ * @dataProvider provideUserScenarios
*/
public function testResetChangeOption( $isRegistered, $isNamed, $expectException ) {
$this->mUserMock->method( 'isRegistered' )->willReturn( $isRegistered );
diff --git a/tests/phpunit/includes/changetags/ChangeTagsTest.php b/tests/phpunit/includes/changetags/ChangeTagsTest.php
index 01465a0dd3a..7180a3f092c 100644
--- a/tests/phpunit/includes/changetags/ChangeTagsTest.php
+++ b/tests/phpunit/includes/changetags/ChangeTagsTest.php
@@ -517,7 +517,7 @@ class ChangeTagsTest extends MediaWikiIntegrationTestCase {
];
}
- public static function dataGetSoftwareTags() {
+ public static function provideGetSoftwareTags() {
return [
[
[
@@ -567,7 +567,7 @@ class ChangeTagsTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider dataGetSoftwareTags
+ * @dataProvider provideGetSoftwareTags
* @covers \MediaWiki\ChangeTags\ChangeTagsStore::getSoftwareTags
*/
public function testGetSoftwareTags( $softwareTags, $expected ) {
diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php
index 07de8ca3ae9..b3f4e97409d 100644
--- a/tests/phpunit/includes/content/ContentHandlerTest.php
+++ b/tests/phpunit/includes/content/ContentHandlerTest.php
@@ -78,7 +78,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->insertPage( 'Smithee', 'A smithee is one who smiths. See also [[Alan Smithee]]' );
}
- public static function dataGetDefaultModelFor() {
+ public static function provideGetDefaultModelFor() {
return [
[ 'Help:Foo', CONTENT_MODEL_WIKITEXT ],
[ 'Help:Foo.js', CONTENT_MODEL_WIKITEXT ],
@@ -107,7 +107,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider dataGetDefaultModelFor
+ * @dataProvider provideGetDefaultModelFor
*/
public function testGetDefaultModelFor( $title, $expectedModelId ) {
$title = Title::newFromText( $title );
@@ -115,7 +115,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertEquals( $expectedModelId, ContentHandler::getDefaultModelFor( $title ) );
}
- public static function dataGetLocalizedName() {
+ public static function provideGetLocalizedName() {
return [
[ null, null ],
[ "xyzzy", null ],
@@ -126,7 +126,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider dataGetLocalizedName
+ * @dataProvider provideGetLocalizedName
*/
public function testGetLocalizedName( $id, $expected ) {
$name = ContentHandler::getLocalizedName( $id );
@@ -143,7 +143,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
}
}
- public static function dataGetPageLanguage() {
+ public static function provideGetPageLanguage() {
global $wgLanguageCode;
return [
@@ -158,7 +158,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider dataGetPageLanguage
+ * @dataProvider provideGetPageLanguage
*/
public function testGetPageLanguage( $title, $expected ) {
$title = Title::newFromText( $title );
@@ -194,7 +194,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertNull( $text );
}
- public static function dataMakeContent() {
+ public static function provideMakeContent() {
return [
[ 'hallo', 'Help:Test', null, null, CONTENT_MODEL_WIKITEXT, false ],
[ 'hallo', 'MediaWiki:Test.js', null, null, CONTENT_MODEL_JAVASCRIPT, false ],
@@ -243,7 +243,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider dataMakeContent
+ * @dataProvider provideMakeContent
*/
public function testMakeContent( $data, $title, $modelId, $format,
$expectedModelId, $shouldFail
diff --git a/tests/phpunit/includes/content/CssContentTest.php b/tests/phpunit/includes/content/CssContentTest.php
index bfaad5d9b64..22088006a0f 100644
--- a/tests/phpunit/includes/content/CssContentTest.php
+++ b/tests/phpunit/includes/content/CssContentTest.php
@@ -29,7 +29,7 @@ class CssContentTest extends TextContentTest {
}
// XXX: currently, preSaveTransform is applied to styles. this may change or become optional.
- public static function dataPreSaveTransform() {
+ public static function providePreSaveTransform() {
return [
[ 'hello this is ~~~',
"hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
@@ -100,7 +100,7 @@ class CssContentTest extends TextContentTest {
// phpcs:enable
}
- public static function dataEquals() {
+ public static function provideEquals() {
return [
[ new CssContent( 'hallo' ), null, false ],
[ new CssContent( 'hallo' ), new CssContent( 'hallo' ), true ],
@@ -110,7 +110,7 @@ class CssContentTest extends TextContentTest {
}
/**
- * @dataProvider dataEquals
+ * @dataProvider provideEquals
*/
public function testEquals( Content $a, ?Content $b = null, $equal = false ) {
$this->assertEquals( $equal, $a->equals( $b ) );
diff --git a/tests/phpunit/includes/content/FallbackContentTest.php b/tests/phpunit/includes/content/FallbackContentTest.php
index 2464675264e..dd1a4732936 100644
--- a/tests/phpunit/includes/content/FallbackContentTest.php
+++ b/tests/phpunit/includes/content/FallbackContentTest.php
@@ -107,7 +107,7 @@ class FallbackContentTest extends MediaWikiLangTestCase {
$this->assertEquals( 'horkyporky', $content->getContentHandler()->getModelID() );
}
- public static function dataIsEmpty() {
+ public static function provideIsEmpty() {
return [
[ '', true ],
[ ' ', false ],
@@ -117,7 +117,7 @@ class FallbackContentTest extends MediaWikiLangTestCase {
}
/**
- * @dataProvider dataIsEmpty
+ * @dataProvider provideIsEmpty
*/
public function testIsEmpty( $text, $empty ) {
$content = $this->newContent( $text );
diff --git a/tests/phpunit/includes/content/JavaScriptContentTest.php b/tests/phpunit/includes/content/JavaScriptContentTest.php
index 8eeb7e675c0..4874ff72d9e 100644
--- a/tests/phpunit/includes/content/JavaScriptContentTest.php
+++ b/tests/phpunit/includes/content/JavaScriptContentTest.php
@@ -26,7 +26,7 @@ class JavaScriptContentTest extends TextContentTest {
}
// XXX: currently, preSaveTransform is applied to scripts. this may change or become optional.
- public static function dataPreSaveTransform() {
+ public static function providePreSaveTransform() {
return [
[ 'hello this is ~~~',
"hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
@@ -40,7 +40,7 @@ class JavaScriptContentTest extends TextContentTest {
];
}
- public static function dataGetRedirectTarget() {
+ public static function provideGetRedirectTargetTextContent() {
return [
[ '#REDIRECT [[Test]]',
null,
@@ -54,7 +54,7 @@ class JavaScriptContentTest extends TextContentTest {
];
}
- public static function dataIsCountable() {
+ public static function provideIsCountable() {
return [
[ '',
null,
@@ -99,7 +99,7 @@ class JavaScriptContentTest extends TextContentTest {
];
}
- public static function dataGetTextForSummary() {
+ public static function provideGetTextForSummary() {
return [
[ "hello\nworld.",
16,
@@ -170,7 +170,7 @@ class JavaScriptContentTest extends TextContentTest {
}
// NOTE: Overridden by subclass!
- public static function dataEquals() {
+ public static function provideEquals() {
return [
[ new JavaScriptContent( "hallo" ), null, false ],
[ new JavaScriptContent( "hallo" ), new JavaScriptContent( "hallo" ), true ],
diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php
index 0d5235f0041..93ceec467c8 100644
--- a/tests/phpunit/includes/content/TextContentTest.php
+++ b/tests/phpunit/includes/content/TextContentTest.php
@@ -55,7 +55,7 @@ class TextContentTest extends MediaWikiLangTestCase {
return new TextContent( $text );
}
- public static function dataGetRedirectTarget() {
+ public static function provideGetRedirectTargetTextContent() {
return [
[ '#REDIRECT [[Test]]',
null,
@@ -64,7 +64,7 @@ class TextContentTest extends MediaWikiLangTestCase {
}
/**
- * @dataProvider dataGetRedirectTarget
+ * @dataProvider provideGetRedirectTargetTextContent
*/
public function testGetRedirectTarget( $text, $expected ) {
$content = $this->newContent( $text );
@@ -78,7 +78,7 @@ class TextContentTest extends MediaWikiLangTestCase {
}
/**
- * @dataProvider dataGetRedirectTarget
+ * @dataProvider provideGetRedirectTargetTextContent
*/
public function testIsRedirect( $text, $expected ) {
$content = $this->newContent( $text );
@@ -86,7 +86,7 @@ class TextContentTest extends MediaWikiLangTestCase {
$this->assertEquals( $expected !== null, $content->isRedirect() );
}
- public static function dataIsCountable() {
+ public static function provideIsCountable() {
return [
[ '',
null,
@@ -102,7 +102,7 @@ class TextContentTest extends MediaWikiLangTestCase {
}
/**
- * @dataProvider dataIsCountable
+ * @dataProvider provideIsCountable
*/
public function testIsCountable( $text, $hasLinks, $mode, $expected ) {
$this->overrideConfigValue( MainConfigNames::ArticleCountMethod, $mode );
@@ -120,7 +120,7 @@ class TextContentTest extends MediaWikiLangTestCase {
);
}
- public static function dataGetTextForSummary() {
+ public static function provideGetTextForSummary() {
return [
[ "hello\nworld.",
16,
@@ -138,7 +138,7 @@ class TextContentTest extends MediaWikiLangTestCase {
}
/**
- * @dataProvider dataGetTextForSummary
+ * @dataProvider provideGetTextForSummary
*/
public function testGetTextForSummary( $text, $maxlength, $expected ) {
$content = $this->newContent( $text );
@@ -178,7 +178,7 @@ class TextContentTest extends MediaWikiLangTestCase {
$this->assertEquals( CONTENT_MODEL_TEXT, $content->getContentHandler()->getModelID() );
}
- public static function dataIsEmpty() {
+ public static function provideIsEmpty() {
return [
[ '', true ],
[ ' ', false ],
@@ -188,7 +188,7 @@ class TextContentTest extends MediaWikiLangTestCase {
}
/**
- * @dataProvider dataIsEmpty
+ * @dataProvider provideIsEmpty
*/
public function testIsEmpty( $text, $empty ) {
$content = $this->newContent( $text );
@@ -196,7 +196,7 @@ class TextContentTest extends MediaWikiLangTestCase {
$this->assertEquals( $empty, $content->isEmpty() );
}
- public static function dataEquals() {
+ public static function provideEquals() {
return [
[ new TextContent( "hallo" ), null, false ],
[ new TextContent( "hallo" ), new TextContent( "hallo" ), true ],
@@ -207,7 +207,7 @@ class TextContentTest extends MediaWikiLangTestCase {
}
/**
- * @dataProvider dataEquals
+ * @dataProvider provideEquals
*/
public function testEquals( Content $a, ?Content $b = null, $equal = false ) {
$this->assertEquals( $equal, $a->equals( $b ) );
diff --git a/tests/phpunit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/includes/content/WikitextContentHandlerTest.php
index 1becb5edae0..704cf1617eb 100644
--- a/tests/phpunit/includes/content/WikitextContentHandlerTest.php
+++ b/tests/phpunit/includes/content/WikitextContentHandlerTest.php
@@ -32,7 +32,7 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
->getContentHandler( CONTENT_MODEL_WIKITEXT );
}
- public static function dataMerge3() {
+ public static function provideMerge3() {
return [
[
"first paragraph
@@ -65,7 +65,7 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
}
/**
- * @dataProvider dataMerge3
+ * @dataProvider provideMerge3
*/
public function testMerge3( $old, $mine, $yours, $expected ) {
$this->markTestSkippedIfNoDiff3();
@@ -80,7 +80,7 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
$this->assertEquals( $expected, $merged ? $merged->getText() : $merged );
}
- public static function dataGetAutosummary() {
+ public static function provideGetAutosummary() {
return [
[
'Hello there, world!',
@@ -130,7 +130,7 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
}
/**
- * @dataProvider dataGetAutosummary
+ * @dataProvider provideGetAutosummary
*/
public function testGetAutosummary( $old, $new, $flags, $expected ) {
$oldContent = $old === null ? null : new WikitextContent( $old );
@@ -144,7 +144,7 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
);
}
- public static function dataGetChangeTag() {
+ public static function provideGetChangeTag() {
return [
[
null,
@@ -221,7 +221,7 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
}
/**
- * @dataProvider dataGetChangeTag
+ * @dataProvider provideGetChangeTag
*/
public function testGetChangeTag( $old, $new, $flags, $expected ) {
$this->overrideConfigValue( MainConfigNames::SoftwareTags, [
diff --git a/tests/phpunit/includes/content/WikitextContentTest.php b/tests/phpunit/includes/content/WikitextContentTest.php
index da4e3bc57fe..5d491095297 100644
--- a/tests/phpunit/includes/content/WikitextContentTest.php
+++ b/tests/phpunit/includes/content/WikitextContentTest.php
@@ -32,7 +32,7 @@ more stuff
return new WikitextContent( $text );
}
- public static function dataGetSection() {
+ public static function provideGetSection() {
return [
[ self::SECTIONS,
"0",
@@ -51,7 +51,7 @@ just a test"
}
/**
- * @dataProvider dataGetSection
+ * @dataProvider provideGetSection
*/
public function testGetSection( $text, $sectionId, $expectedText ) {
$content = $this->newContent( $text );
@@ -66,7 +66,7 @@ just a test"
$this->assertEquals( $expectedText, $sectionText );
}
- public static function dataReplaceSection() {
+ public static function provideReplaceSection() {
return [
[ self::SECTIONS,
"0",
@@ -105,7 +105,7 @@ just a test"
}
/**
- * @dataProvider dataReplaceSection
+ * @dataProvider provideReplaceSection
*/
public function testReplaceSection( $text, $section, $with, $sectionTitle, $expected ) {
$content = $this->newContent( $text );
@@ -125,7 +125,7 @@ just a test"
$this->assertEquals( "hello world", $content->getText() );
}
- public static function dataPreSaveTransform() {
+ public static function providePreSaveTransform() {
return [
[ 'hello this is ~~~',
"hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
@@ -140,7 +140,7 @@ just a test"
];
}
- public static function dataGetRedirectTarget() {
+ public static function provideGetRedirectTargetTextContent() {
return [
[ '#REDIRECT [[Test]]',
'Test',
@@ -154,7 +154,7 @@ just a test"
];
}
- public static function dataGetTextForSummary() {
+ public static function provideGetTextForSummary() {
return [
[ "hello\nworld.",
16,
@@ -171,7 +171,7 @@ just a test"
];
}
- public static function dataIsCountable() {
+ public static function provideIsCountable() {
return [
[ '',
null,
@@ -325,7 +325,7 @@ just a test"
);
}
- public static function dataEquals() {
+ public static function provideEquals() {
return [
[ new WikitextContent( "hallo" ), null, false ],
[ new WikitextContent( "hallo" ), new WikitextContent( "hallo" ), true ],
@@ -335,7 +335,7 @@ just a test"
];
}
- public static function dataGetDeletionUpdates() {
+ public static function provideGetDeletionUpdates() {
return [
[
CONTENT_MODEL_WIKITEXT, "hello ''world''\n",
diff --git a/tests/phpunit/includes/import/ImportTest.php b/tests/phpunit/includes/import/ImportTest.php
index f92f62d6e9d..e49fc7e1005 100644
--- a/tests/phpunit/includes/import/ImportTest.php
+++ b/tests/phpunit/includes/import/ImportTest.php
@@ -15,7 +15,7 @@ class ImportTest extends MediaWikiLangTestCase {
/**
* @covers \WikiImporter
- * @dataProvider getUnknownTagsXML
+ * @dataProvider provideUnknownTagsXML
* @param string $xml
* @param string $text
* @param string $title
@@ -36,7 +36,7 @@ class ImportTest extends MediaWikiLangTestCase {
);
}
- public function getUnknownTagsXML() {
+ public function provideUnknownTagsXML() {
return [
[
<<< EOF
@@ -75,7 +75,7 @@ EOF
/**
* @covers \WikiImporter::handlePage
- * @dataProvider getRedirectXML
+ * @dataProvider provideRedirectXML
* @param string $xml
* @param string|null $redirectTitle
*/
@@ -99,7 +99,7 @@ EOF
$this->assertEquals( $redirectTitle, $redirect );
}
- public function getRedirectXML() {
+ public function provideRedirectXML() {
return [
[
<<< EOF
@@ -159,7 +159,7 @@ EOF
/**
* @covers \WikiImporter::handleSiteInfo
- * @dataProvider getSiteInfoXML
+ * @dataProvider provideSiteInfoXML
* @param string $xml
* @param array|null $namespaces
*/
@@ -180,7 +180,7 @@ EOF
$this->assertEquals( $importNamespaces, $namespaces );
}
- public function getSiteInfoXML() {
+ public function provideSiteInfoXML() {
return [
[
<<< EOF
diff --git a/tests/phpunit/includes/language/TimeAdjustTest.php b/tests/phpunit/includes/language/TimeAdjustTest.php
index 2dfd3960cb9..f41af34d4f9 100644
--- a/tests/phpunit/includes/language/TimeAdjustTest.php
+++ b/tests/phpunit/includes/language/TimeAdjustTest.php
@@ -11,7 +11,7 @@ class TimeAdjustTest extends MediaWikiLangTestCase {
/**
* Test offset usage for a given Language::userAdjust
- * @dataProvider dataUserAdjust
+ * @dataProvider provideUserAdjust
*/
public function testUserAdjust( string $date, $correction, string $expected ) {
$this->overrideConfigValue( MainConfigNames::LocalTZoffset, self::LOCAL_TZ_OFFSET );
@@ -22,7 +22,7 @@ class TimeAdjustTest extends MediaWikiLangTestCase {
);
}
- public static function dataUserAdjust() {
+ public static function provideUserAdjust() {
// Note: make sure to use dates in the past, especially with geographical time zones, to avoid any
// chance of tests failing due to a change to the time zone rules.
yield 'Literal int 0 (technically undocumented)' => [ '20221015120000', 0, '20221015120000' ];
diff --git a/tests/phpunit/includes/page/WikiPageDbTest.php b/tests/phpunit/includes/page/WikiPageDbTest.php
index d4e30e48fac..1d4a4e73ee1 100644
--- a/tests/phpunit/includes/page/WikiPageDbTest.php
+++ b/tests/phpunit/includes/page/WikiPageDbTest.php
@@ -1004,7 +1004,7 @@ just a test
more stuff
";
- public function dataReplaceSection() {
+ public function provideReplaceSection() {
// NOTE: assume the Help namespace to contain wikitext
return [
[ 'Help:WikiPageTest_testReplaceSection',
@@ -1053,7 +1053,7 @@ more stuff
}
/**
- * @dataProvider dataReplaceSection
+ * @dataProvider provideReplaceSection
*/
public function testReplaceSectionContent( $title, $model, $text, $section,
$with, $sectionTitle, $expected
@@ -1068,7 +1068,7 @@ more stuff
}
/**
- * @dataProvider dataReplaceSection
+ * @dataProvider provideReplaceSection
*/
public function testReplaceSectionAtRev( $title, $model, $text, $section,
$with, $sectionTitle, $expected
diff --git a/tests/phpunit/includes/parser/SanitizerTest.php b/tests/phpunit/includes/parser/SanitizerTest.php
index f60c38cea2b..fd5654615c4 100644
--- a/tests/phpunit/includes/parser/SanitizerTest.php
+++ b/tests/phpunit/includes/parser/SanitizerTest.php
@@ -63,7 +63,7 @@ class SanitizerTest extends MediaWikiIntegrationTestCase {
];
}
- public function dataRemoveHTMLtags() {
+ public function provideRemoveHTMLtags() {
return [
// former testSelfClosingTag
[
@@ -94,14 +94,14 @@ class SanitizerTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider dataRemoveHTMLtags
+ * @dataProvider provideRemoveHTMLtags
*/
public function testInternalRemoveHTMLtags( $input, $output, $msg = null ) {
$this->assertEquals( $output, Sanitizer::internalRemoveHtmlTags( $input ), $msg );
}
/**
- * @dataProvider dataRemoveHTMLtags
+ * @dataProvider provideRemoveHTMLtags
*/
public function testRemoveSomeTags( $input, $output, $msg = null ) {
$this->assertEquals( $output, Sanitizer::removeSomeTags( $input ), $msg );
diff --git a/tests/phpunit/includes/skins/SideBarTest.php b/tests/phpunit/includes/skins/SideBarTest.php
index 80a60fa93f5..88d5d89eac8 100644
--- a/tests/phpunit/includes/skins/SideBarTest.php
+++ b/tests/phpunit/includes/skins/SideBarTest.php
@@ -224,7 +224,7 @@ class SideBarTest extends MediaWikiLangTestCase {
/**
* Test $wgExternaLinkTarget in sidebar
- * @dataProvider dataRespectExternallinktarget
+ * @dataProvider provideRespectExternallinktarget
*/
public function testRespectExternallinktarget( $externalLinkTarget ) {
$this->overrideConfigValue( MainConfigNames::ExternalLinkTarget, $externalLinkTarget );
@@ -234,7 +234,7 @@ class SideBarTest extends MediaWikiLangTestCase {
$this->assertEquals( $attribs['target'], $externalLinkTarget );
}
- public static function dataRespectExternallinktarget() {
+ public static function provideRespectExternallinktarget() {
return [
[ '_blank' ],
[ '_self' ],
diff --git a/tests/phpunit/includes/skins/SkinTest.php b/tests/phpunit/includes/skins/SkinTest.php
index 243036b341e..b449f526ec2 100644
--- a/tests/phpunit/includes/skins/SkinTest.php
+++ b/tests/phpunit/includes/skins/SkinTest.php
@@ -144,7 +144,7 @@ class SkinTest extends MediaWikiIntegrationTestCase {
}
}
- public function providGetPageClasses() {
+ public function provideGetPageClasses() {
yield 'normal page has namespace' => [
new TitleValue( NS_MAIN, 'Test' ), // $title
$this->mockRegisteredUltimateAuthority(), // $authority
@@ -184,7 +184,7 @@ class SkinTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider providGetPageClasses
+ * @dataProvider provideGetPageClasses
*/
public function testGetPageClasses(
LinkTarget $title,
diff --git a/tests/phpunit/includes/title/TitleTest.php b/tests/phpunit/includes/title/TitleTest.php
index 1f8a938e6e3..02b1e142411 100644
--- a/tests/phpunit/includes/title/TitleTest.php
+++ b/tests/phpunit/includes/title/TitleTest.php
@@ -146,7 +146,7 @@ class TitleTest extends MediaWikiIntegrationTestCase {
$this->assertEquals( $expectedBool, $title->hasSubjectNamespace( $ns ) );
}
- public function dataGetContentModel() {
+ public function provideGetContentModel() {
return [
[ 'Help:Foo', CONTENT_MODEL_WIKITEXT ],
[ 'Help:Foo.js', CONTENT_MODEL_WIKITEXT ],
@@ -172,7 +172,7 @@ class TitleTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider dataGetContentModel
+ * @dataProvider provideGetContentModel
* @covers \MediaWiki\Title\Title::getContentModel
*/
public function testGetContentModel( $title, $expectedModelId ) {
@@ -181,7 +181,7 @@ class TitleTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider dataGetContentModel
+ * @dataProvider provideGetContentModel
* @covers \MediaWiki\Title\Title::hasContentModel
*/
public function testHasContentModel( $title, $expectedModelId ) {
diff --git a/tests/phpunit/integration/includes/Permissions/GrantsLocalizationTest.php b/tests/phpunit/integration/includes/Permissions/GrantsLocalizationTest.php
index 00d4f1528db..185f1fc0ab2 100644
--- a/tests/phpunit/integration/includes/Permissions/GrantsLocalizationTest.php
+++ b/tests/phpunit/integration/includes/Permissions/GrantsLocalizationTest.php
@@ -24,7 +24,7 @@ class GrantsLocalizationTest extends MediaWikiIntegrationTestCase {
}
/**
- * @dataProvider grantDescriptions
+ * @dataProvider provideGrantDescriptions
*/
public function testGetGrantDescription( string $grant ) {
$message = new Message( 'grant-' . $grant );
@@ -38,7 +38,7 @@ class GrantsLocalizationTest extends MediaWikiIntegrationTestCase {
);
}
- public function grantDescriptions() {
+ public function provideGrantDescriptions() {
yield [ 'blockusers' ];
yield [ 'createeditmovepage' ];
yield [ 'delete' ];
diff --git a/tests/phpunit/unit/includes/GlobalFunctions/WfStringToBoolTest.php b/tests/phpunit/unit/includes/GlobalFunctions/WfStringToBoolTest.php
index b99d695ffc2..88bc6dbb993 100644
--- a/tests/phpunit/unit/includes/GlobalFunctions/WfStringToBoolTest.php
+++ b/tests/phpunit/unit/includes/GlobalFunctions/WfStringToBoolTest.php
@@ -6,7 +6,7 @@
*/
class WfStringToBoolTest extends MediaWikiUnitTestCase {
- public function getTestCases() {
+ public function provideTestCases() {
return [
[ 'true', true ],
[ 'on', true ],
@@ -36,7 +36,7 @@ class WfStringToBoolTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider getTestCases
+ * @dataProvider provideTestCases
* @param string $str
* @param bool $bool
*/
diff --git a/tests/phpunit/unit/includes/Settings/Source/EtcdSourceTest.php b/tests/phpunit/unit/includes/Settings/Source/EtcdSourceTest.php
index e0aad8e46da..1019ccf1894 100644
--- a/tests/phpunit/unit/includes/Settings/Source/EtcdSourceTest.php
+++ b/tests/phpunit/unit/includes/Settings/Source/EtcdSourceTest.php
@@ -101,7 +101,7 @@ class EtcdSourceTest extends TestCase {
}
/**
- * @dataProvider serverFailures
+ * @dataProvider provideServerFailures
*/
public function testLoadAllServersFailed( GuzzleException $exception ) {
$client = $this->mockClientWithResponses( [
@@ -125,7 +125,7 @@ class EtcdSourceTest extends TestCase {
}
/**
- * @dataProvider serverFailures
+ * @dataProvider provideServerFailures
*/
public function testLoadSomeServersFailed( GuzzleException $exception ) {
$client = $this->mockClientWithResponses( [
@@ -200,7 +200,7 @@ class EtcdSourceTest extends TestCase {
/**
* All possible server-side exceptions.
*/
- public function serverFailures(): array {
+ public function provideServerFailures(): array {
return [
[
new ConnectException(
diff --git a/tests/phpunit/unit/includes/content/FallbackContentHandlerTest.php b/tests/phpunit/unit/includes/content/FallbackContentHandlerTest.php
index 9c19163ee44..2b67aab0559 100644
--- a/tests/phpunit/unit/includes/content/FallbackContentHandlerTest.php
+++ b/tests/phpunit/unit/includes/content/FallbackContentHandlerTest.php
@@ -49,7 +49,7 @@ class FallbackContentHandlerTest extends MediaWikiUnitTestCase {
$this->assertSame( '', $content->getData() );
}
- public function dataIsSupportedFormat() {
+ public function provideIsSupportedFormat() {
return [
[ null, true ],
[ 'application/octet-stream', true ],
@@ -60,7 +60,7 @@ class FallbackContentHandlerTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider dataIsSupportedFormat
+ * @dataProvider provideIsSupportedFormat
*/
public function testIsSupportedFormat( $format, $supported ) {
$handler = new FallbackContentHandler( 'horkyporky' );
diff --git a/tests/phpunit/unit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/unit/includes/content/WikitextContentHandlerTest.php
index 6f6e21c50bf..ab0c2ec4d29 100644
--- a/tests/phpunit/unit/includes/content/WikitextContentHandlerTest.php
+++ b/tests/phpunit/unit/includes/content/WikitextContentHandlerTest.php
@@ -83,7 +83,7 @@ class WikitextContentHandlerTest extends MediaWikiUnitTestCase {
$this->assertSame( '', $content->getText() );
}
- public function dataIsSupportedFormat() {
+ public function provideIsSupportedFormat() {
return [
[ null, true ],
[ CONTENT_FORMAT_WIKITEXT, true ],
@@ -92,7 +92,7 @@ class WikitextContentHandlerTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider dataIsSupportedFormat
+ * @dataProvider provideIsSupportedFormat
*/
public function testIsSupportedFormat( $format, $supported ) {
$handler = $this->newWikitextContentHandler();
diff --git a/tests/phpunit/unit/includes/libs/CookieTest.php b/tests/phpunit/unit/includes/libs/CookieTest.php
index 4fe11e56745..42d89fb9866 100644
--- a/tests/phpunit/unit/includes/libs/CookieTest.php
+++ b/tests/phpunit/unit/includes/libs/CookieTest.php
@@ -13,7 +13,7 @@ class CookieTest extends TestCase {
use MediaWikiCoversValidator;
/**
- * @dataProvider cookieDomains
+ * @dataProvider provideCookieDomains
* @covers \Cookie::validateCookieDomain
*/
public function testValidateCookieDomain( $expected, $domain, $origin = null ) {
@@ -27,7 +27,7 @@ class CookieTest extends TestCase {
$this->assertEquals( $expected, $ok, $msg );
}
- public static function cookieDomains() {
+ public static function provideCookieDomains() {
return [
[ false, "org" ],
[ false, ".org" ],
diff --git a/tests/phpunit/unit/includes/libs/HashRingTest.php b/tests/phpunit/unit/includes/libs/HashRingTest.php
index b5ae0dbbf70..1205f49c7b1 100644
--- a/tests/phpunit/unit/includes/libs/HashRingTest.php
+++ b/tests/phpunit/unit/includes/libs/HashRingTest.php
@@ -119,7 +119,7 @@ class HashRingTest extends TestCase {
}
/**
- * @dataProvider providor_getHashLocationWeights
+ * @dataProvider provideHashLocationWeights
*/
public function testHashRingRatios( $locations, $expectedHits ) {
$ring = new HashRing( $locations, 'whirlpool' );
@@ -131,7 +131,7 @@ class HashRingTest extends TestCase {
$this->assertEquals( $expectedHits, $locationStats );
}
- public static function providor_getHashLocationWeights() {
+ public static function provideHashLocationWeights() {
return [
[
[ 'big' => 10, 'medium' => 5, 'small' => 1 ],
@@ -141,7 +141,7 @@ class HashRingTest extends TestCase {
}
/**
- * @dataProvider providor_getHashLocationWeights2
+ * @dataProvider provideHashLocationWeights2
*/
public function testHashRingRatios2( $locations, $expected ) {
$ring = new HashRing( $locations, 'sha1' );
@@ -154,7 +154,7 @@ class HashRingTest extends TestCase {
$this->assertEquals( $expected, $locationStats );
}
- public static function providor_getHashLocationWeights2() {
+ public static function provideHashLocationWeights2() {
return [
[
[ 'big1' => 10, 'big2' => 10, 'big3' => 10, 'small1' => 1, 'small2' => 1 ],
diff --git a/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php b/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php
index 34955cb57e2..c3054880ad2 100644
--- a/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php
+++ b/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php
@@ -332,7 +332,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider getWithSetCallback_provider
+ * @dataProvider getWithSetCallbackProvider
* @param array $extOpts
*/
public function testGetWithSetCallback( array $extOpts ) {
@@ -519,7 +519,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider getWithSetCallback_provider
+ * @dataProvider getWithSetCallbackProvider
* @param array $extOpts
*/
public function testGetWithSetCallback_touched( array $extOpts ) {
@@ -574,7 +574,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
$this->assertSame( 2, $wasSet, "Value was recomputed once" );
}
- public static function getWithSetCallback_provider() {
+ public static function getWithSetCallbackProvider() {
return [
[ [], false ],
[ [ 'version' => 1 ], true ]
@@ -688,7 +688,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider getWithSetCallback_provider
+ * @dataProvider getWithSetCallbackProvider
* @param array $extOpts
*/
public function testGetMultiWithSetCallback( array $extOpts ) {
@@ -850,7 +850,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider getMultiWithSetCallbackRefresh_provider
+ * @dataProvider getMultiWithSetCallbackRefreshProvider
* @param bool $expiring
* @param bool $popular
* @param array $idsByKey
@@ -927,7 +927,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
}
}
- public static function getMultiWithSetCallbackRefresh_provider() {
+ public static function getMultiWithSetCallbackRefreshProvider() {
return [
[ true, true, [ 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4 ] ],
[ true, false, [ 'a' => 'x', 'b' => 'y', 'c' => 'z', 'd' => 'w' ] ],
@@ -936,13 +936,13 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
];
}
- public static function getMultiWithUnionSetCallback_provider() {
+ public static function getMultiWithUnionSetCallbackProvider() {
yield 'default' => [ [] ];
yield 'versioned' => [ [ 'version' => 1 ] ];
}
/**
- * @dataProvider getMultiWithUnionSetCallback_provider
+ * @dataProvider getMultiWithUnionSetCallbackProvider
* @param array $extOpts
*/
public function testGetMultiWithUnionSetCallback( array $extOpts ) {
@@ -1135,7 +1135,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider getMultiWithSetCallbackRefresh_provider
+ * @dataProvider getMultiWithSetCallbackRefreshProvider
* @param bool $expiring
* @param bool $popular
* @param array $idsByKey
@@ -1424,7 +1424,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
$this->assertSame( 3, $calls, 'Callback was not used; used interim' );
}
- public static function getBusyValues_Provider() {
+ public static function getBusyValuesProvider() {
$hash = new HashBagOStuff( [] );
return [
@@ -1443,7 +1443,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider getBusyValues_Provider
+ * @dataProvider getBusyValuesProvider
*/
public function testBusyValueTypes( $busyValue, $expected ) {
[ $cache, $bag ] = $this->newWanCache();
@@ -1677,7 +1677,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider getWithSetCallback_provider
+ * @dataProvider getWithSetCallbackProvider
* @param array $extOpts
* @param bool $versioned
*/
diff --git a/tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php b/tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php
index 7c994442701..d4b861bd939 100644
--- a/tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php
+++ b/tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php
@@ -31,7 +31,7 @@ class RESTBagOStuffTest extends \MediaWikiUnitTestCase {
}
/**
- * @dataProvider dataGet
+ * @dataProvider provideDataGet
*/
public function testGet( $serializationType, $hmacKey, $data ) {
$classReflect = new ReflectionClass( RESTBagOStuff::class );
@@ -54,7 +54,7 @@ class RESTBagOStuffTest extends \MediaWikiUnitTestCase {
$this->assertEquals( 'somedata', $result );
}
- public static function dataGet() {
+ public static function provideDataGet() {
// Make sure the defaults are last, so the $bag is left as expected for the next test
return [
[ 'JSON', '12345', 'JSON.Us1wli82zEJ6DNQnCG//w+MShOFrdx9wCdfTUhPPA2w=."somedata"' ],
@@ -100,7 +100,7 @@ class RESTBagOStuffTest extends \MediaWikiUnitTestCase {
}
/**
- * @dataProvider dataGet
+ * @dataProvider provideDataGet
*/
public function testPut( $serializationType, $hmacKey, $data ) {
$classReflect = new ReflectionClass( RESTBagOStuff::class );
diff --git a/tests/phpunit/unit/includes/search/SearchIndexFieldTest.php b/tests/phpunit/unit/includes/search/SearchIndexFieldTest.php
index 91310b3efe9..ecbd4845411 100644
--- a/tests/phpunit/unit/includes/search/SearchIndexFieldTest.php
+++ b/tests/phpunit/unit/includes/search/SearchIndexFieldTest.php
@@ -6,7 +6,7 @@
*/
class SearchIndexFieldTest extends \MediaWikiUnitTestCase {
- public function getMergeCases() {
+ public function provideMergeCases() {
return [
[ 0, 'test', 0, 'test', true ],
[ SearchIndexField::INDEX_TYPE_NESTED, 'test',
@@ -17,7 +17,7 @@ class SearchIndexFieldTest extends \MediaWikiUnitTestCase {
}
/**
- * @dataProvider getMergeCases
+ * @dataProvider provideMergeCases
* @param int $t1
* @param string $n1
* @param int $t2
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:31 AM (11 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227450
Default Alt Text
(37 KB)
Attached To
Mode
rMW mediawiki
Attached
Detach File
Event Timeline
Log In to Comment