jenkins-bot has submitted this change and it was merged.
Change subject: Add lots of array type hints to tests
......................................................................
Add lots of array type hints to tests
The idea is pretty simple: This patch only touches tests. Code coverage
is not an issue in test code, right? So if all these tests still succeed
with the added type hints, they can't be wrong. There can not be an
unknown caller that calls one of these methods with an other type, right?
Change-Id: Ibd056718e51491f0b260051c21c54ed95584a673
---
M client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php
M client/tests/phpunit/includes/Hooks/ParserOutputUpdateHookHandlersTest.php
M client/tests/phpunit/includes/LangLinkHandlerTest.php
M client/tests/phpunit/includes/OtherProjectsSitesGeneratorTest.php
M client/tests/phpunit/includes/RepoLinkerTest.php
M client/tests/phpunit/includes/Usage/EntityUsageTest.php
M client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
M client/tests/phpunit/includes/api/PageTermsTest.php
M client/tests/phpunit/includes/store/AddUsagesForPageJobTest.php
M repo/tests/phpunit/includes/ChangeDispatcherTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpSiteLinkTest.php
M repo/tests/phpunit/includes/Diff/EntityContentDiffViewTest.php
M repo/tests/phpunit/includes/Diff/EntityDiffVisualizerTest.php
M repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php
M repo/tests/phpunit/includes/EditEntityTest.php
M repo/tests/phpunit/includes/EntityModificationTestHelper.php
M repo/tests/phpunit/includes/Interactors/TermIndexSearchInteractorTest.php
M repo/tests/phpunit/includes/LabelDescriptionDuplicateDetectorTest.php
M
repo/tests/phpunit/includes/Localizer/ChangeOpValidationExceptionLocalizerTest.php
M repo/tests/phpunit/includes/Localizer/GenericExceptionLocalizerTest.php
M repo/tests/phpunit/includes/Localizer/MessageExceptionLocalizerTest.php
M repo/tests/phpunit/includes/Localizer/ParseExceptionLocalizerTest.php
M repo/tests/phpunit/includes/Validators/NumberValidatorTest.php
M repo/tests/phpunit/includes/Validators/TermValidatorFactoryTest.php
M repo/tests/phpunit/includes/Validators/ValidatorErrorLocalizerTest.php
M repo/tests/phpunit/includes/api/ApiErrorReporterTest.php
M repo/tests/phpunit/includes/api/EntityTestHelper.php
M repo/tests/phpunit/includes/api/GetEntitiesTest.php
M repo/tests/phpunit/includes/api/IndependentWikibaseApiTestCase.php
M repo/tests/phpunit/includes/api/SearchEntitiesTest.php
M repo/tests/phpunit/includes/api/SetSiteLinkTest.php
M repo/tests/phpunit/includes/content/EntityContentTest.php
M repo/tests/phpunit/includes/rdf/ComplexValueRdfBuilderTest.php
M repo/tests/phpunit/includes/rdf/SimpleValueRdfBuilderTest.php
M repo/tests/phpunit/includes/rdf/SiteLinksRdfBuilderTest.php
M repo/tests/phpunit/includes/rdf/TermsRdfBuilderTest.php
M repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
M repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
M repo/tests/phpunit/includes/store/sql/SqlChangeDispatchCoordinatorTest.php
39 files changed, 181 insertions(+), 128 deletions(-)
Approvals:
Addshore: Looks good to me, approved
Jeroen De Dauw: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git
a/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php
b/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php
index 6ff4632..de50f35 100644
--- a/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php
+++ b/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php
@@ -78,7 +78,7 @@
/**
* @dataProvider attachBadgesToOutputProvider
*/
- public function testAttachBadgesToOutput( $expected, $languageLinks ) {
+ public function testAttachBadgesToOutput( array $expected, array
$languageLinks ) {
$languageLinkBadgeDisplay =
$this->getLanguageLinkBadgeDisplay();
$parserOutput = new ParserOutput();
diff --git
a/client/tests/phpunit/includes/Hooks/ParserOutputUpdateHookHandlersTest.php
b/client/tests/phpunit/includes/Hooks/ParserOutputUpdateHookHandlersTest.php
index d99b4d7..04b25d4 100644
--- a/client/tests/phpunit/includes/Hooks/ParserOutputUpdateHookHandlersTest.php
+++ b/client/tests/phpunit/includes/Hooks/ParserOutputUpdateHookHandlersTest.php
@@ -291,10 +291,10 @@
public function testDoContentAlterParserOutput(
Title $title,
$expectedItem,
- $pagePropsBefore,
- $expectedLanguageLinks,
- $expectedSisterLinks,
- $expectedBadges
+ array $pagePropsBefore,
+ array $expectedLanguageLinks,
+ array $expectedSisterLinks,
+ array $expectedBadges = null
) {
$parserOutput = $this->newParserOutput( $pagePropsBefore,
array() );
$handler = $this->newParserOutputUpdateHookHandlers();
diff --git a/client/tests/phpunit/includes/LangLinkHandlerTest.php
b/client/tests/phpunit/includes/LangLinkHandlerTest.php
index 2dae641..5a3336a 100644
--- a/client/tests/phpunit/includes/LangLinkHandlerTest.php
+++ b/client/tests/phpunit/includes/LangLinkHandlerTest.php
@@ -209,7 +209,7 @@
/**
* @dataProvider provideGetEntityLinks
*/
- public function testGetEntityLinks( $title, $expectedLinks ) {
+ public function testGetEntityLinks( $title, array $expectedLinks ) {
if ( is_string( $title ) ) {
$title = Title::newFromText( $title );
}
@@ -240,7 +240,7 @@
);
}
- protected function makeParserOutput( $langLinks, $noExternalLangLinks =
array() ) {
+ protected function makeParserOutput( array $langLinks, array
$noExternalLangLinks = array() ) {
$out = new ParserOutput();
NoLangLinkHandler::setNoExternalLangLinks( $out,
$noExternalLangLinks );
@@ -254,7 +254,7 @@
/**
* @dataProvider provideGetNoExternalLangLinks
*/
- public function testGetNoExternalLangLinks( $noExternalLangLinks ) {
+ public function testGetNoExternalLangLinks( array $noExternalLangLinks
) {
$out = $this->makeParserOutput( array(), $noExternalLangLinks );
$nel = $this->langLinkHandler->getNoExternalLangLinks( $out );
@@ -314,7 +314,7 @@
/**
* @dataProvider provideUseRepoLinks
*/
- public function testUseRepoLinks( $title, $noExternalLangLinks,
$expected ) {
+ public function testUseRepoLinks( $title, array $noExternalLangLinks,
$expected ) {
if ( is_string( $title ) ) {
$title = Title::newFromText( $title );
$title->resetArticleID( 1 );
@@ -395,7 +395,12 @@
/**
* @dataProvider provideGetEffectiveRepoLinks
*/
- public function testGetEffectiveRepoLinks( $title, $langLinks,
$noExternalLangLinks, $expectedLinks ) {
+ public function testGetEffectiveRepoLinks(
+ $title,
+ array $langLinks,
+ array $noExternalLangLinks,
+ array $expectedLinks
+ ) {
if ( is_string( $title ) ) {
$title = Title::newFromText( $title );
}
@@ -413,7 +418,7 @@
*
* @return array
*/
- private function getPlainLinks( $links ) {
+ private function getPlainLinks( array $links ) {
$flat = array();
foreach ( $links as $link ) {
@@ -469,7 +474,13 @@
/**
* @dataProvider provideAddLinksFromRepository
*/
- public function testAddLinksFromRepository( $title, $langLinks,
$noExternalLangLinks, $expectedLinks, $expectedBadges ) {
+ public function testAddLinksFromRepository(
+ $title,
+ array $langLinks,
+ array $noExternalLangLinks,
+ array $expectedLinks,
+ array $expectedBadges
+ ) {
if ( is_string( $title ) ) {
$title = Title::newFromText( $title );
}
@@ -535,7 +546,11 @@
/**
* @dataProvider provideFilterRepoLinksByGroup
*/
- public function testFilterRepoLinksByGroup( $repoLinks, $allowedGroups,
$expectedLinks ) {
+ public function testFilterRepoLinksByGroup(
+ array $repoLinks,
+ array $allowedGroups,
+ array $expectedLinks
+ ) {
$actualLinks = $this->langLinkHandler->filterRepoLinksByGroup(
$repoLinks, $allowedGroups );
$this->assertEquals( $expectedLinks, $actualLinks );
@@ -582,7 +597,7 @@
/**
* @dataProvider provideSuppressRepoLinks
*/
- public function testSuppressRepoLinks( $repoLinks, $nel, $expectedLinks
) {
+ public function testSuppressRepoLinks( array $repoLinks, array $nel,
array $expectedLinks ) {
$out = new ParserOutput();
$out->setProperty( 'noexternallanglinks', serialize( $nel ) );
diff --git a/client/tests/phpunit/includes/OtherProjectsSitesGeneratorTest.php
b/client/tests/phpunit/includes/OtherProjectsSitesGeneratorTest.php
index 2eb632f..5a3f9a7 100644
--- a/client/tests/phpunit/includes/OtherProjectsSitesGeneratorTest.php
+++ b/client/tests/phpunit/includes/OtherProjectsSitesGeneratorTest.php
@@ -26,7 +26,7 @@
/**
* @dataProvider otherProjectSitesProvider
*/
- public function testOtherProjectSiteIds( array $supportedSites,
$localSiteId, $expectedSiteIds ) {
+ public function testOtherProjectSiteIds( array $supportedSites,
$localSiteId, array $expectedSiteIds ) {
$siteStore = $this->getSiteStoreMock();
$otherProjectsSitesProvider = new OtherProjectsSitesGenerator(
$siteStore, $localSiteId, array( 'wikidata' ) );
diff --git a/client/tests/phpunit/includes/RepoLinkerTest.php
b/client/tests/phpunit/includes/RepoLinkerTest.php
index a54a6b9..831b2c7 100644
--- a/client/tests/phpunit/includes/RepoLinkerTest.php
+++ b/client/tests/phpunit/includes/RepoLinkerTest.php
@@ -19,7 +19,7 @@
*/
class RepoLinkerTest extends \PHPUnit_Framework_TestCase {
- protected function getRepoSettings() {
+ private function getRepoSettings() {
return array(
array(
'baseUrl' => '//www.example.com',
@@ -51,7 +51,7 @@
);
}
- protected function getRepoLinkerForSettings( $settings ) {
+ private function getRepoLinkerForSettings( array $settings ) {
return new RepoLinker(
$settings['baseUrl'],
$settings['articlePath'],
@@ -100,7 +100,7 @@
/**
* @dataProvider getEntityTitleProvider
*/
- public function testGetEntityTitle( $expected, $settings, EntityId
$entityId ) {
+ public function testGetEntityTitle( $expected, array $settings,
EntityId $entityId ) {
$repoLinker = $this->getRepoLinkerForSettings( $settings );
$this->assertEquals( $expected, $repoLinker->getEntityTitle(
$entityId ) );
@@ -121,7 +121,7 @@
/**
* @dataProvider getPageUrlProvider
*/
- public function testGetPageUrl( $expected, $settings, $page ) {
+ public function testGetPageUrl( $expected, array $settings, $page ) {
$repoLinker = $this->getRepoLinkerForSettings( $settings );
$this->assertEquals( $expected, $repoLinker->getPageUrl( $page
) );
@@ -143,7 +143,7 @@
/**
* @dataProvider getPageUrlInvalidProvider
*/
- public function testGetPageUrlInvalidThrowsException( $settings, $page
) {
+ public function testGetPageUrlInvalidThrowsException( array $settings,
$page ) {
$repoLinker = $this->getRepoLinkerForSettings( $settings );
$this->setExpectedException( 'InvalidArgumentException' );
$repoLinker->getPageUrl( $page );
@@ -160,7 +160,7 @@
/**
* @dataProvider formatLinkProvider
*/
- public function testFormatLink( $expected, $settings, $url, $text,
$attribs ) {
+ public function testFormatLink( $expected, array $settings, $url,
$text, array $attribs ) {
$repoLinker = $this->getRepoLinkerForSettings( $settings );
$this->assertEquals( $expected, $repoLinker->formatLink( $url,
$text, $attribs ) );
@@ -175,7 +175,7 @@
$settings[1],
'//example.com/wiki/Special:Log/delete',
'delete',
- null
+ array()
),
array(
'<a class="plainlinks" tabindex="1"
href="http://www.example.com/w/index.php'
@@ -194,7 +194,7 @@
/**
* @dataProvider buildEntityLinkProvider
*/
- public function testBuildEntityLink( $expected, $settings, $entityId,
$classes ) {
+ public function testBuildEntityLink( $expected, array $settings,
EntityId $entityId, array $classes ) {
$repoLinker = $this->getRepoLinkerForSettings( $settings );
$this->assertEquals( $expected, $repoLinker->buildEntityLink(
$entityId, $classes ) );
@@ -228,7 +228,7 @@
/**
* @dataProvider getEntityUrlProvider
*/
- public function testGetEntityUrl( $expected, $settings, $entityId ) {
+ public function testGetEntityUrl( $expected, array $settings, EntityId
$entityId ) {
$repoLinker = $this->getRepoLinkerForSettings( $settings );
$this->assertEquals( $expected, $repoLinker->getEntityUrl(
$entityId ) );
@@ -254,7 +254,7 @@
/**
* @dataProvider getBaseUrlProvider
*/
- public function testGetBaseUrl( $expected, $settings ) {
+ public function testGetBaseUrl( $expected, array $settings ) {
$repoLinker = $this->getRepoLinkerForSettings( $settings );
$this->assertEquals( $expected, $repoLinker->getBaseUrl() );
@@ -278,7 +278,7 @@
/**
* @dataProvider getApiUrlProvider
*/
- public function testGetApiUrl( $expected, $settings ) {
+ public function testGetApiUrl( $expected, array $settings ) {
$repoLinker = $this->getRepoLinkerForSettings( $settings );
$this->assertEquals( $expected, $repoLinker->getApiUrl() );
@@ -298,7 +298,7 @@
/**
* @dataProvider getIndexUrlProvider
*/
- public function testGetIndexUrl( $expected, $settings ) {
+ public function testGetIndexUrl( $expected, array $settings ) {
$repoLinker = $this->getRepoLinkerForSettings( $settings );
$this->assertEquals( $expected, $repoLinker->getIndexUrl() );
@@ -318,7 +318,7 @@
/**
* @dataProvider addQueryParamsProvider
*/
- public function testAddQueryParams( $expected, $settings, $url, $params
) {
+ public function testAddQueryParams( $expected, array $settings, $url,
array $params ) {
$repoLinker = $this->getRepoLinkerForSettings( $settings );
$this->assertEquals( $expected, $repoLinker->addQueryParams(
$url, $params ) );
diff --git a/client/tests/phpunit/includes/Usage/EntityUsageTest.php
b/client/tests/phpunit/includes/Usage/EntityUsageTest.php
index 48f9bc6..7025cd4 100644
--- a/client/tests/phpunit/includes/Usage/EntityUsageTest.php
+++ b/client/tests/phpunit/includes/Usage/EntityUsageTest.php
@@ -85,7 +85,7 @@
/**
* @dataProvider aspectKeyProvider
*/
- public function testStripModifier( $aspectKey, $expectedParts ) {
+ public function testStripModifier( $aspectKey, array $expectedParts ) {
$aspect = EntityUsage::stripModifier( $aspectKey );
$this->assertEquals( $expectedParts[0], $aspect );
}
@@ -93,7 +93,7 @@
/**
* @dataProvider aspectKeyProvider
*/
- public function testSplitAspectKey( $aspectKey, $expectedParts ) {
+ public function testSplitAspectKey( $aspectKey, array $expectedParts ) {
$parts = EntityUsage::splitAspectKey( $aspectKey );
$this->assertEquals( $expectedParts, $parts );
}
diff --git a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
index ebcc7c1..8d1e306 100644
--- a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
@@ -547,11 +547,11 @@
/**
* @param DatabaseBase $db
- * @param mixed $conditions
+ * @param array $conditions
*
* @return bool
*/
- private function rowExists( DatabaseBase $db, $conditions ) {
+ private function rowExists( DatabaseBase $db, array $conditions ) {
$count = $db->selectRowCount(
EntityUsageTable::DEFAULT_TABLE_NAME, '*', $conditions );
return $count > 0;
}
diff --git a/client/tests/phpunit/includes/api/PageTermsTest.php
b/client/tests/phpunit/includes/api/PageTermsTest.php
index 520a24f..3c5ab7f 100644
--- a/client/tests/phpunit/includes/api/PageTermsTest.php
+++ b/client/tests/phpunit/includes/api/PageTermsTest.php
@@ -97,7 +97,7 @@
*
* @return EntityId[]
*/
- private function makeEntityIds( $pageIds ) {
+ private function makeEntityIds( array $pageIds ) {
$entityIds = array();
foreach ( $pageIds as $pid ) {
@@ -182,7 +182,7 @@
*
* @return TermIndexEntry[]
*/
- private function makeTermsFromGroups( EntityId $entityId, $termGroups )
{
+ private function makeTermsFromGroups( EntityId $entityId, array
$termGroups ) {
$terms = array();
foreach ( $termGroups as $type => $group ) {
@@ -213,7 +213,7 @@
*
* @return EntityIdLookup
*/
- private function getEntityIdLookup( $entityIds ) {
+ private function getEntityIdLookup( array $entityIds ) {
$idLookup = $this->getMock( 'Wikibase\Store\EntityIdLookup' );
$idLookup->expects( $this->any() )
->method( 'getEntityIds' )
diff --git a/client/tests/phpunit/includes/store/AddUsagesForPageJobTest.php
b/client/tests/phpunit/includes/store/AddUsagesForPageJobTest.php
index fbfb744..28882c9 100644
--- a/client/tests/phpunit/includes/store/AddUsagesForPageJobTest.php
+++ b/client/tests/phpunit/includes/store/AddUsagesForPageJobTest.php
@@ -83,9 +83,8 @@
/**
* @dataProvider provideConstructor_failure
- * @param array $params
*/
- public function testConstructor_failure( $params ) {
+ public function testConstructor_failure( array $params ) {
$this->setExpectedException( 'InvalidArgumentException' );
$title = Title::makeTitle( NS_MAIN, 'Foo' );
diff --git a/repo/tests/phpunit/includes/ChangeDispatcherTest.php
b/repo/tests/phpunit/includes/ChangeDispatcherTest.php
index f3870c9..ed19004 100644
--- a/repo/tests/phpunit/includes/ChangeDispatcherTest.php
+++ b/repo/tests/phpunit/includes/ChangeDispatcherTest.php
@@ -51,7 +51,7 @@
*
* @return ChangeDispatcher
*/
- private function getChangeDispatcher( ChangeDispatchCoordinator
$coordinator, &$notifications = array() ) {
+ private function getChangeDispatcher( ChangeDispatchCoordinator
$coordinator, array &$notifications = array() ) {
$dispatcher = new ChangeDispatcher(
$coordinator,
$this->getNotificationSender( $notifications ),
@@ -68,7 +68,7 @@
*
* @return ChangeNotificationSender
*/
- private function getNotificationSender( &$notifications = array() ) {
+ private function getNotificationSender( array &$notifications = array()
) {
$sender = $this->getMock(
'Wikibase\Repo\Notifications\ChangeNotificationSender' );
$sender->expects( $this->any() )
@@ -275,18 +275,14 @@
/**
* @dataProvider provideGetPendingChanges
*/
- public function testGetPendingChanges( $siteId, $afterId, $batchSize,
$batchChunkFactor, $expectedChanges, $expectedSeen ) {
+ public function testGetPendingChanges( $siteId, $afterId, $batchSize,
$batchChunkFactor, array $expectedChanges, $expectedSeen ) {
$coordinator = $this->getMock(
'Wikibase\Store\ChangeDispatchCoordinator' );
$dispatcher = $this->getChangeDispatcher( $coordinator );
-
$dispatcher->setBatchSize( $batchSize );
$dispatcher->setBatchChunkFactor( $batchChunkFactor );
- $pending = $dispatcher->getPendingChanges(
- $siteId,
- $afterId
- );
+ $pending = $dispatcher->getPendingChanges( $siteId, $afterId );
$this->assertChanges( $expectedChanges, $pending[0] );
$this->assertEquals( $expectedSeen, $pending[1] );
@@ -358,7 +354,7 @@
/**
* @dataProvider provideDispatchTo
*/
- public function testDispatchTo( $batchSize, $wikiState,
$expectedFinalSeen, $expectedNotifications ) {
+ public function testDispatchTo( $batchSize, array $wikiState,
$expectedFinalSeen, array $expectedNotifications ) {
$expectedFinalState = array_merge( $wikiState, array(
'chd_seen' => $expectedFinalSeen ) );
$coordinator = $this->getMock(
'Wikibase\Store\ChangeDispatchCoordinator' );
@@ -370,16 +366,10 @@
->method( 'releaseClient' )
->with( $expectedFinalState );
- $dispatcher = $this->getChangeDispatcher(
- $coordinator,
- $notifications
- );
-
+ $notifications = array();
+ $dispatcher = $this->getChangeDispatcher( $coordinator,
$notifications );
$dispatcher->setBatchSize( $batchSize );
-
- $dispatcher->dispatchTo(
- $wikiState
- );
+ $dispatcher->dispatchTo( $wikiState );
$this->assertNotifications( $expectedNotifications,
$notifications );
}
@@ -390,14 +380,14 @@
}, $changes );
}
- private function assertChanges( $expected, $actual ) {
+ private function assertChanges( array $expected, $actual ) {
$expected = $this->getChangeIds( $expected );
$actual = $this->getChangeIds( $actual );
$this->assertEquals( $expected, $actual );
}
- private function assertNotifications( $expected, $notifications ) {
+ private function assertNotifications( array $expected, array
$notifications ) {
foreach ( $notifications as &$n ) {
$n[1] = $this->getChangeIds( $n[1] );
}
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpSiteLinkTest.php
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpSiteLinkTest.php
index 1fb8f4d..9f81e6c 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpSiteLinkTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpSiteLinkTest.php
@@ -54,7 +54,7 @@
*
* @expectedException InvalidArgumentException
*/
- public function testConstructorWithInvalidArguments( $siteId,
$linkPage, $badges = null ) {
+ public function testConstructorWithInvalidArguments( $siteId,
$linkPage, array $badges = null ) {
new ChangeOpSiteLink( $siteId, $linkPage, $badges );
}
diff --git a/repo/tests/phpunit/includes/Diff/EntityContentDiffViewTest.php
b/repo/tests/phpunit/includes/Diff/EntityContentDiffViewTest.php
index e8e0b9f..70bda75 100644
--- a/repo/tests/phpunit/includes/Diff/EntityContentDiffViewTest.php
+++ b/repo/tests/phpunit/includes/Diff/EntityContentDiffViewTest.php
@@ -128,7 +128,7 @@
/**
* @dataProvider itemProvider
*/
- public function testGenerateContentDiffBody( ItemContent $itemContent,
ItemContent $itemContent2, $matchers ) {
+ public function testGenerateContentDiffBody( ItemContent $itemContent,
ItemContent $itemContent2, array $matchers ) {
$context = new DerivativeContext( RequestContext::getMain() );
$context->setLanguage( Language::factory( 'en' ) );
diff --git a/repo/tests/phpunit/includes/Diff/EntityDiffVisualizerTest.php
b/repo/tests/phpunit/includes/Diff/EntityDiffVisualizerTest.php
index c402beb..90839b0 100644
--- a/repo/tests/phpunit/includes/Diff/EntityDiffVisualizerTest.php
+++ b/repo/tests/phpunit/includes/Diff/EntityDiffVisualizerTest.php
@@ -132,7 +132,7 @@
/**
* @dataProvider diffProvider
*/
- public function testGenerateEntityContentDiffBody( EntityContentDiff
$diff, $matchers ) {
+ public function testGenerateEntityContentDiffBody( EntityContentDiff
$diff, array $matchers ) {
$visualizer = $this->getVisualizer();
$html = $visualizer->visualizeEntityContentDiff( $diff );
diff --git a/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php
b/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php
index 2f03d9d..7d3cc09 100644
--- a/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php
+++ b/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php
@@ -269,7 +269,7 @@
/**
* @dataProvider typeFilterProvider
*/
- public function testTypeFilterDump( array $ids, $type, $expectedIds ) {
+ public function testTypeFilterDump( array $ids, $type, array
$expectedIds ) {
$dumper = $this->newDumpGenerator( $ids );
$pager = $this->makeIdPager( $ids );
diff --git a/repo/tests/phpunit/includes/EditEntityTest.php
b/repo/tests/phpunit/includes/EditEntityTest.php
index bd0c5cd..608cdaa 100644
--- a/repo/tests/phpunit/includes/EditEntityTest.php
+++ b/repo/tests/phpunit/includes/EditEntityTest.php
@@ -73,7 +73,7 @@
*
* @return EntityPermissionChecker
*/
- private function getEntityPermissionChecker( $permissions ) {
+ private function getEntityPermissionChecker( array $permissions = null
) {
$permissionChecker = $this->getMock(
'Wikibase\Repo\Store\EntityPermissionChecker' );
$checkAction = function( $user, $action ) use ( $permissions ) {
@@ -623,7 +623,7 @@
/**
* @dataProvider dataAttemptSaveRateLimit
*/
- public function testAttemptSaveRateLimit( $limits, $groups, $edits ) {
+ public function testAttemptSaveRateLimit( array $limits, array $groups,
array $edits ) {
$repo = $this->getMockRepository();
$this->setMwGlobals(
diff --git a/repo/tests/phpunit/includes/EntityModificationTestHelper.php
b/repo/tests/phpunit/includes/EntityModificationTestHelper.php
index 7dc3c5c..ae56a3e 100644
--- a/repo/tests/phpunit/includes/EntityModificationTestHelper.php
+++ b/repo/tests/phpunit/includes/EntityModificationTestHelper.php
@@ -68,7 +68,7 @@
* If the entity does not have an ID and the corresponding array
key is a string,
* they key is used as the entity ID.
*/
- public function putEntities( $entities ) {
+ public function putEntities( array $entities ) {
foreach ( $entities as $key => $entity ) {
$id = is_string( $key ) ? $key : null;
$this->putEntity( $entity, $id );
@@ -83,7 +83,7 @@
* the corresponding array key and value; the key is parsed as
an EntityId, the value
* is also parsed if it's a string.
*/
- public function putRedirects( $redirects ) {
+ public function putRedirects( array $redirects ) {
foreach ( $redirects as $key => $redirect ) {
if ( !( $redirect instanceof EntityRedirect ) ) {
$from = $this->idParser->parse( $key );
diff --git
a/repo/tests/phpunit/includes/Interactors/TermIndexSearchInteractorTest.php
b/repo/tests/phpunit/includes/Interactors/TermIndexSearchInteractorTest.php
index bfdcca6..b8b4359 100644
--- a/repo/tests/phpunit/includes/Interactors/TermIndexSearchInteractorTest.php
+++ b/repo/tests/phpunit/includes/Interactors/TermIndexSearchInteractorTest.php
@@ -306,7 +306,11 @@
* @param array $params
* @param array[] $expectedTermsDetails each element has a 'term',
'termtype' and a 'entityId' key
*/
- public function testSearchForEntities_returnsExpectedResults(
$interactor, $params, $expectedTermsDetails ) {
+ public function testSearchForEntities_returnsExpectedResults(
+ TermIndexSearchInteractor $interactor,
+ array $params,
+ array $expectedTermsDetails
+ ) {
// $interactor->searchForEntities() call
$results = call_user_func_array( array( $interactor,
'searchForEntities' ), $params );
diff --git
a/repo/tests/phpunit/includes/LabelDescriptionDuplicateDetectorTest.php
b/repo/tests/phpunit/includes/LabelDescriptionDuplicateDetectorTest.php
index 2d3d5b6..4fc6683 100644
--- a/repo/tests/phpunit/includes/LabelDescriptionDuplicateDetectorTest.php
+++ b/repo/tests/phpunit/includes/LabelDescriptionDuplicateDetectorTest.php
@@ -107,7 +107,14 @@
/**
* @dataProvider provideDetectLabelDescriptionConflicts
*/
- public function testDetectLabelDescriptionConflicts( $world,
$entityType, $labels, $descriptions, $ignore, $expectedErrors ) {
+ public function testDetectLabelDescriptionConflicts(
+ array $world,
+ $entityType,
+ array $labels,
+ array $descriptions,
+ $ignore,
+ array $expectedErrors
+ ) {
$detector = new LabelDescriptionDuplicateDetector( new
MockTermIndex( $world ) );
$result = $detector->detectLabelDescriptionConflicts(
$entityType, $labels, $descriptions, $ignore );
@@ -245,7 +252,14 @@
/**
* @dataProvider provideDetectLabelConflicts
*/
- public function testDetectLabelConflicts( $world, $entityType, $labels,
$aliases, $ignore, $expectedErrors ) {
+ public function testDetectLabelConflicts(
+ array $world,
+ $entityType,
+ array $labels,
+ array $aliases = null,
+ $ignore,
+ array $expectedErrors
+ ) {
$detector = new LabelDescriptionDuplicateDetector( new
MockTermIndex( $world ) );
$result = $detector->detectLabelConflicts( $entityType,
$labels, $aliases, $ignore );
@@ -257,7 +271,7 @@
* @param Result $result
* @param Error[] $expectedErrors
*/
- protected function assertResult( Result $result, $expectedErrors ) {
+ protected function assertResult( Result $result, array $expectedErrors
) {
$this->assertEquals( empty( $expectedErrors ),
$result->isValid(), 'isValid()' );
$errors = $result->getErrors();
diff --git
a/repo/tests/phpunit/includes/Localizer/ChangeOpValidationExceptionLocalizerTest.php
b/repo/tests/phpunit/includes/Localizer/ChangeOpValidationExceptionLocalizerTest.php
index 8cecd0b..3deaa67 100644
---
a/repo/tests/phpunit/includes/Localizer/ChangeOpValidationExceptionLocalizerTest.php
+++
b/repo/tests/phpunit/includes/Localizer/ChangeOpValidationExceptionLocalizerTest.php
@@ -53,7 +53,7 @@
/**
* @dataProvider provideGetExceptionMessage
*/
- public function testGetExceptionMessage( Exception $ex, $expectedKey,
$expectedParams ) {
+ public function testGetExceptionMessage( Exception $ex, $expectedKey,
array $expectedParams ) {
$formatter = $this->getMockFormatter();
$localizer = new ChangeOpValidationExceptionLocalizer(
$formatter );
diff --git
a/repo/tests/phpunit/includes/Localizer/GenericExceptionLocalizerTest.php
b/repo/tests/phpunit/includes/Localizer/GenericExceptionLocalizerTest.php
index 358f92c..ccb4f8d 100644
--- a/repo/tests/phpunit/includes/Localizer/GenericExceptionLocalizerTest.php
+++ b/repo/tests/phpunit/includes/Localizer/GenericExceptionLocalizerTest.php
@@ -30,7 +30,7 @@
/**
* @dataProvider provideGetExceptionMessage
*/
- public function testGetExceptionMessage( Exception $ex, $expectedKey,
$expectedParams ) {
+ public function testGetExceptionMessage( Exception $ex, $expectedKey,
array $expectedParams ) {
$localizer = new GenericExceptionLocalizer();
$this->assertTrue( $localizer->hasExceptionMessage( $ex ) );
diff --git
a/repo/tests/phpunit/includes/Localizer/MessageExceptionLocalizerTest.php
b/repo/tests/phpunit/includes/Localizer/MessageExceptionLocalizerTest.php
index af82638..63fb470 100644
--- a/repo/tests/phpunit/includes/Localizer/MessageExceptionLocalizerTest.php
+++ b/repo/tests/phpunit/includes/Localizer/MessageExceptionLocalizerTest.php
@@ -37,7 +37,7 @@
/**
* @dataProvider provideGetExceptionMessage
*/
- public function testGetExceptionMessage( Exception $ex, $expectedKey,
$expectedParams ) {
+ public function testGetExceptionMessage( Exception $ex, $expectedKey,
array $expectedParams ) {
$localizer = new MessageExceptionLocalizer();
$this->assertTrue( $localizer->hasExceptionMessage( $ex ) );
diff --git
a/repo/tests/phpunit/includes/Localizer/ParseExceptionLocalizerTest.php
b/repo/tests/phpunit/includes/Localizer/ParseExceptionLocalizerTest.php
index eb75d69..0aa10d2 100644
--- a/repo/tests/phpunit/includes/Localizer/ParseExceptionLocalizerTest.php
+++ b/repo/tests/phpunit/includes/Localizer/ParseExceptionLocalizerTest.php
@@ -27,7 +27,7 @@
/**
* @dataProvider provideGetExceptionMessage
*/
- public function testGetExceptionMessage( Exception $ex, $expectedKey,
$expectedParams ) {
+ public function testGetExceptionMessage( Exception $ex, $expectedKey,
array $expectedParams ) {
$localizer = new ParseExceptionLocalizer();
$this->assertTrue( $localizer->hasExceptionMessage( $ex ) );
diff --git a/repo/tests/phpunit/includes/Validators/NumberValidatorTest.php
b/repo/tests/phpunit/includes/Validators/NumberValidatorTest.php
index 6bfb6e9..bde26c8 100644
--- a/repo/tests/phpunit/includes/Validators/NumberValidatorTest.php
+++ b/repo/tests/phpunit/includes/Validators/NumberValidatorTest.php
@@ -52,7 +52,7 @@
/**
* @dataProvider invalidValueProvider
*/
- public function testValidateInvalidValue( $value, $code, $params =
array() ) {
+ public function testValidateInvalidValue( $value, $code, array $params
= array() ) {
$validator = new NumberValidator();
$result = $validator->validate( $value );
diff --git
a/repo/tests/phpunit/includes/Validators/TermValidatorFactoryTest.php
b/repo/tests/phpunit/includes/Validators/TermValidatorFactoryTest.php
index 4555f69..14773cb 100644
--- a/repo/tests/phpunit/includes/Validators/TermValidatorFactoryTest.php
+++ b/repo/tests/phpunit/includes/Validators/TermValidatorFactoryTest.php
@@ -30,7 +30,7 @@
*
* @return TermValidatorFactory
*/
- private function newFactory( $maxLength, $languageCodes ) {
+ private function newFactory( $maxLength, array $languageCodes ) {
$idParser = new BasicEntityIdParser();
$mockProvider = new ChangeOpTestMockProvider( $this );
diff --git
a/repo/tests/phpunit/includes/Validators/ValidatorErrorLocalizerTest.php
b/repo/tests/phpunit/includes/Validators/ValidatorErrorLocalizerTest.php
index 1aeabf0..a10ce13 100644
--- a/repo/tests/phpunit/includes/Validators/ValidatorErrorLocalizerTest.php
+++ b/repo/tests/phpunit/includes/Validators/ValidatorErrorLocalizerTest.php
@@ -61,7 +61,7 @@
/**
* @dataProvider provideGetErrorMessage()
*/
- public function testGetErrorMessage( $error, $params ) {
+ public function testGetErrorMessage( $error, array $params ) {
$localizer = new ValidatorErrorLocalizer(
$this->getMockFormatter() );
$message = $localizer->getErrorMessage( $error );
diff --git a/repo/tests/phpunit/includes/api/ApiErrorReporterTest.php
b/repo/tests/phpunit/includes/api/ApiErrorReporterTest.php
index d57a6a6..249e164 100644
--- a/repo/tests/phpunit/includes/api/ApiErrorReporterTest.php
+++ b/repo/tests/phpunit/includes/api/ApiErrorReporterTest.php
@@ -26,7 +26,13 @@
*/
class ApiErrorReporterTest extends \MediaWikiTestCase {
- protected function assertUsageException( $info, $code, $httpStatusCode,
$expectedDataFields, UsageException $ex ) {
+ protected function assertUsageException(
+ $info,
+ $code,
+ $httpStatusCode,
+ array $expectedDataFields,
+ UsageException $ex
+ ) {
$messageArray = $ex->getMessageArray();
$this->assertArrayHasKey( 'code', $messageArray );
@@ -44,11 +50,9 @@
$this->assertEquals( $httpStatusCode, $ex->getCode() );
}
- if ( $expectedDataFields ) {
- foreach ( $expectedDataFields as $path => $value ) {
- $path = explode( '/', $path );
- $this->assertValueAtPath( $value, $path,
$messageArray );
- }
+ foreach ( $expectedDataFields as $path => $value ) {
+ $path = explode( '/', $path );
+ $this->assertValueAtPath( $value, $path, $messageArray
);
}
}
@@ -132,7 +136,14 @@
/**
* @dataProvider exceptionProvider
*/
- public function testDieException( $exception, $code, $httpStatusCode,
$extradata, $infoPattern, $expectedDataFields ) {
+ public function testDieException(
+ $exception,
+ $code,
+ $httpStatusCode,
+ array $extradata = null,
+ $infoPattern,
+ array $expectedDataFields
+ ) {
$api = new ApiMain();
$localizer = $this->getExceptionLocalizer();
$reporter = new ApiErrorReporter( $api, $localizer,
Language::factory( 'de' ) );
@@ -169,7 +180,7 @@
/**
* @dataProvider messageProvider
*/
- public function testDieMessage( $code, $param, $infoPattern,
$expectedDataFields ) {
+ public function testDieMessage( $code, $param, $infoPattern, array
$expectedDataFields ) {
$api = new ApiMain();
$localizer = $this->getExceptionLocalizer();
$reporter = new ApiErrorReporter( $api, $localizer,
Language::factory( 'de' ) );
@@ -226,7 +237,14 @@
/**
* @dataProvider statusProvider
*/
- public function testDieStatus( Status $status, $code, $httpStatusCode,
$extradata, $infoPattern, $expectedDataFields ) {
+ public function testDieStatus(
+ Status $status,
+ $code,
+ $httpStatusCode,
+ array $extradata = null,
+ $infoPattern,
+ array $expectedDataFields
+ ) {
$api = new ApiMain();
$localizer = $this->getExceptionLocalizer();
$reporter = new ApiErrorReporter( $api, $localizer,
Language::factory( 'de' ) );
@@ -273,7 +291,14 @@
/**
* @dataProvider errorProvider
*/
- public function testDieError( $description, $code, $httpStatusCode,
$extradata, $infoPattern, $expectedDataFields ) {
+ public function testDieError(
+ $description,
+ $code,
+ $httpStatusCode,
+ array $extradata,
+ $infoPattern,
+ array $expectedDataFields
+ ) {
$api = new ApiMain();
$localizer = $this->getExceptionLocalizer();
$reporter = new ApiErrorReporter( $api, $localizer,
Language::factory( 'de' ) );
@@ -308,7 +333,7 @@
/**
* @dataProvider warningProvider
*/
- public function testReportStatusWarnings( Status $status,
$expectedDataFields ) {
+ public function testReportStatusWarnings( Status $status, array
$expectedDataFields ) {
$api = new ApiMain();
$localizer = $this->getExceptionLocalizer();
$reporter = new ApiErrorReporter( $api, $localizer,
Language::factory( 'de' ) );
diff --git a/repo/tests/phpunit/includes/api/EntityTestHelper.php
b/repo/tests/phpunit/includes/api/EntityTestHelper.php
index ec3542a..27031a5 100644
--- a/repo/tests/phpunit/includes/api/EntityTestHelper.php
+++ b/repo/tests/phpunit/includes/api/EntityTestHelper.php
@@ -289,7 +289,7 @@
* @throws OutOfBoundsException
* @return mixed
*/
- public static function getEntityOutput( $handle, $props = null, $langs
= null ) {
+ public static function getEntityOutput( $handle, array $props = null,
array $langs = null ) {
if ( !array_key_exists( $handle, self::$entityOutput ) ) {
throw new OutOfBoundsException( "No entity output
defined with handle {$handle}" );
}
@@ -309,7 +309,7 @@
*
* @return array Array of entity output with props and langs removed
*/
- protected static function stripUnwantedOutputValues( $entityOutput,
$props = array(), $langs = null ) {
+ protected static function stripUnwantedOutputValues( array
$entityOutput, array $props = array(), array $langs = null ) {
$entityProps = array();
$props[] = 'type'; // always return the type so we can
demobilize
foreach ( $props as $prop ) {
@@ -343,7 +343,7 @@
* @param string $id
* @param array $entity
*/
- public static function registerEntity( $handle, $id, $entity = null ) {
+ public static function registerEntity( $handle, $id, array $entity =
null ) {
self::$activeHandles[ $handle ] = $id;
self::$activeIds[ $id ] = $handle;
if ( $entity ) {
diff --git a/repo/tests/phpunit/includes/api/GetEntitiesTest.php
b/repo/tests/phpunit/includes/api/GetEntitiesTest.php
index 1c69fb7..b051739 100644
--- a/repo/tests/phpunit/includes/api/GetEntitiesTest.php
+++ b/repo/tests/phpunit/includes/api/GetEntitiesTest.php
@@ -163,7 +163,7 @@
* This method tests all valid API requests
* @dataProvider provideData
*/
- public function testGetEntities( $params, $expected ) {
+ public function testGetEntities( array $params, array $expected ) {
// -- setup any further data
-----------------------------------------------
$params['ids'] = implode( '|', $this->getIdsFromHandlesAndIds(
$params ) );
$params = $this->removeHandles( $params );
@@ -203,7 +203,7 @@
}
}
- private function getIdsFromHandlesAndIds( $params ) {
+ private function getIdsFromHandlesAndIds( array $params ) {
if ( array_key_exists( 'ids', $params ) ) {
$ids = explode( '|', $params['ids'] );
} else {
@@ -221,14 +221,14 @@
return $ids;
}
- private function removeHandles( $params ) {
+ private function removeHandles( array $params ) {
if ( array_key_exists( 'handles', $params ) ) {
unset( $params['handles'] );
}
return $params;
}
- private function calculateExpectedData( $expected, $params ) {
+ private function calculateExpectedData( array $expected, array $params
) {
//expect the props in params or the default props of the api
if ( array_key_exists( 'props', $params ) ) {
$expected['props'] = explode( '|', $params['props'] );
@@ -256,7 +256,7 @@
return $expected;
}
- private function assertEntityResult( $entity, $expected ) {
+ private function assertEntityResult( array $entity, array $expected ) {
//Assert individual props of each entity (if we want them, make
sure they are there)
if ( in_array( 'info', $expected['props'] ) ) {
$this->assertEntityPropsInfo( $entity );
@@ -290,7 +290,7 @@
/**
* @param array $entity
*/
- private function assertEntityPropsInfo( $entity ) {
+ private function assertEntityPropsInfo( array $entity ) {
$this->assertArrayHasKey( 'pageid', $entity, 'An entity is
missing the pageid value' );
$this->assertInternalType( 'integer', $entity['pageid'] );
$this->assertGreaterThan( 0, $entity['pageid'] );
@@ -321,7 +321,7 @@
/**
* @param array $entity
*/
- private function assertEntityPropsSitelinksUrls( $entity ) {
+ private function assertEntityPropsSitelinksUrls( array $entity ) {
foreach ( $entity['sitelinks'] as $siteLink ) {
$this->assertArrayHasKey( 'url', $siteLink );
$this->assertNotEmpty( $siteLink['url'] );
@@ -331,7 +331,7 @@
/**
* @param array $entity
*/
- private function assertEntityPropsSitelinksBadges( $entity ) {
+ private function assertEntityPropsSitelinksBadges( array $entity ) {
foreach ( $entity['sitelinks'] as $siteLink ) {
$this->assertArrayHasKey( 'badges', $siteLink );
$this->assertInternalType( 'array', $siteLink['badges']
);
@@ -343,7 +343,7 @@
}
}
- private function assertEntitySitelinkSorting( $entity, $expected ) {
+ private function assertEntitySitelinkSorting( array $entity, array
$expected ) {
$last = '';
if ( $expected['dir'] == 'descending' ) {
$last = 'zzzzzzzz';
@@ -367,7 +367,7 @@
}
}
- private function assertNormalization( $result, $params ) {
+ private function assertNormalization( array $result, array $params ) {
$this->assertArrayHasKey( 'normalized', $result );
$this->assertEquals(
$params['titles'],
@@ -419,7 +419,7 @@
/**
* @dataProvider provideExceptionData
*/
- public function testGetEntitiesExceptions( $params, $expected ) {
+ public function testGetEntitiesExceptions( array $params, array
$expected ) {
// -- set any defaults ------------------------------------
$params['action'] = 'wbgetentities';
if ( array_key_exists( 'handles', $params ) ) {
@@ -487,7 +487,6 @@
'language' => 'zh-hk',
'value' => '廣東的省會。',
),
-
),
),
'Oslo Fallback' => array(
@@ -571,10 +570,10 @@
*/
public function testLanguageFallback(
$handle,
- $languages,
- $expectedLabels = null,
- $expectedDescriptions = null,
- $props = array()
+ array $languages,
+ array $expectedLabels = null,
+ array $expectedDescriptions = null,
+ array $props = array()
) {
$id = EntityTestHelper::getId( $handle );
diff --git a/repo/tests/phpunit/includes/api/IndependentWikibaseApiTestCase.php
b/repo/tests/phpunit/includes/api/IndependentWikibaseApiTestCase.php
index 553ce9f..56b7ef1 100644
--- a/repo/tests/phpunit/includes/api/IndependentWikibaseApiTestCase.php
+++ b/repo/tests/phpunit/includes/api/IndependentWikibaseApiTestCase.php
@@ -50,7 +50,7 @@
*
* @return array api request result
*/
- public function doApiRequest( $params ) {
+ public function doApiRequest( array $params ) {
$module = $this->getModule( $params );
$module->execute();
@@ -94,7 +94,7 @@
*
* @return ApiBase
*/
- protected function getModule( $params ) {
+ protected function getModule( array $params ) {
global $wgRequest;
$requestContext = new RequestContext();
diff --git a/repo/tests/phpunit/includes/api/SearchEntitiesTest.php
b/repo/tests/phpunit/includes/api/SearchEntitiesTest.php
index 1732abe..84a1497 100644
--- a/repo/tests/phpunit/includes/api/SearchEntitiesTest.php
+++ b/repo/tests/phpunit/includes/api/SearchEntitiesTest.php
@@ -101,7 +101,7 @@
*
* @return
TermIndexSearchInteractor|\PHPUnit_Framework_MockObject_MockObject
*/
- private function getMockSearchInteractor( $params, $returnResults =
array() ) {
+ private function getMockSearchInteractor( array $params, array
$returnResults = array() ) {
$mock = $this->getMockBuilder(
'Wikibase\Repo\Interactors\TermIndexSearchInteractor' )
->disableOriginalConstructor()
->getMock();
diff --git a/repo/tests/phpunit/includes/api/SetSiteLinkTest.php
b/repo/tests/phpunit/includes/api/SetSiteLinkTest.php
index bd08b02..522293a 100644
--- a/repo/tests/phpunit/includes/api/SetSiteLinkTest.php
+++ b/repo/tests/phpunit/includes/api/SetSiteLinkTest.php
@@ -393,7 +393,7 @@
* @param array $value
* @return array
*/
- private function expectionPlaceholder( $value ) {
+ private function expectionPlaceholder( array $value ) {
foreach ( $value as &$site ) {
if ( !isset( $site['badges'] ) ) {
continue;
@@ -414,7 +414,7 @@
/**
* @dataProvider provideData
*/
- public function testSetSiteLink( $params, $expected ) {
+ public function testSetSiteLink( array $params, array $expected ) {
// -- set any defaults ------------------------------------
if ( array_key_exists( 'handle', $params ) ) {
$params['id'] = EntityTestHelper::getId(
$params['handle'] );
@@ -534,7 +534,7 @@
/**
* @dataProvider provideExceptionData
*/
- public function testSetSiteLinkExceptions( $params, $expected ) {
+ public function testSetSiteLinkExceptions( array $params, array
$expected ) {
// -- set any defaults ------------------------------------
$params['action'] = 'wbsetsitelink';
@@ -553,7 +553,7 @@
/**
* @dataProvider provideBadBadgeData
*/
- public function testBadBadges( $params ) {
+ public function testBadBadges( array $params ) {
// -- set any defaults ------------------------------------
$params['action'] = 'wbsetsitelink';
diff --git a/repo/tests/phpunit/includes/content/EntityContentTest.php
b/repo/tests/phpunit/includes/content/EntityContentTest.php
index 02ddcbf..b7de843 100644
--- a/repo/tests/phpunit/includes/content/EntityContentTest.php
+++ b/repo/tests/phpunit/includes/content/EntityContentTest.php
@@ -247,7 +247,7 @@
/**
* @dataProvider provideGetEntityPageProperties
*/
- public function testGetEntityPageProperties( EntityContent $content,
$pageProps ) {
+ public function testGetEntityPageProperties( EntityContent $content,
array $pageProps ) {
$actual = $content->getEntityPageProperties();
foreach ( $pageProps as $key => $value ) {
diff --git a/repo/tests/phpunit/includes/rdf/ComplexValueRdfBuilderTest.php
b/repo/tests/phpunit/includes/rdf/ComplexValueRdfBuilderTest.php
index bb7c631..e91955d 100644
--- a/repo/tests/phpunit/includes/rdf/ComplexValueRdfBuilderTest.php
+++ b/repo/tests/phpunit/includes/rdf/ComplexValueRdfBuilderTest.php
@@ -386,7 +386,7 @@
/**
* @dataProvider provideAddSnakValue
*/
- public function testAddSnakValue( PropertyId $propertyId, DataValue
$value, $expectedTriples, $expectedValueTriples ) {
+ public function testAddSnakValue( PropertyId $propertyId, DataValue
$value, array $expectedTriples, array $expectedValueTriples ) {
$writer = $this->getTestData()->getNTriplesWriter();
$writer->about( RdfVocabulary::NS_ENTITY, 'Q11' );
diff --git a/repo/tests/phpunit/includes/rdf/SimpleValueRdfBuilderTest.php
b/repo/tests/phpunit/includes/rdf/SimpleValueRdfBuilderTest.php
index 93bf834..c52c6a5 100644
--- a/repo/tests/phpunit/includes/rdf/SimpleValueRdfBuilderTest.php
+++ b/repo/tests/phpunit/includes/rdf/SimpleValueRdfBuilderTest.php
@@ -224,7 +224,7 @@
/**
* @dataProvider provideAddSnakValue
*/
- public function testAddSnakValue( PropertyId $propertyId, DataValue
$value, $expectedTriples ) {
+ public function testAddSnakValue( PropertyId $propertyId, DataValue
$value, array $expectedTriples ) {
$writer = $this->getTestData()->getNTriplesWriter();
$writer->about( RdfVocabulary::NS_ENTITY, 'Q11' );
diff --git a/repo/tests/phpunit/includes/rdf/SiteLinksRdfBuilderTest.php
b/repo/tests/phpunit/includes/rdf/SiteLinksRdfBuilderTest.php
index 19f04ed..3fe059a 100644
--- a/repo/tests/phpunit/includes/rdf/SiteLinksRdfBuilderTest.php
+++ b/repo/tests/phpunit/includes/rdf/SiteLinksRdfBuilderTest.php
@@ -43,7 +43,7 @@
*
* @return SiteLinksRdfBuilder
*/
- private function newBuilder( $sites = null ) {
+ private function newBuilder( array $sites = null ) {
$vocabulary = $this->getTestData()->getVocabulary();
$writer = $this->getTestData()->getNTriplesWriter();
@@ -97,7 +97,7 @@
/**
* @dataProvider provideAddEntity
*/
- public function testAddEntity( $entityName, $dataSetName, $sites = null
) {
+ public function testAddEntity( $entityName, $dataSetName, array $sites
= null ) {
$entity = $this->getTestData()->getEntity( $entityName );
$builder = $this->newBuilder( $sites );
@@ -109,7 +109,7 @@
/**
* @dataProvider provideAddEntity
*/
- public function testAddSiteLinks( $entityName, $dataSetName, $sites =
null ) {
+ public function testAddSiteLinks( $entityName, $dataSetName, array
$sites = null ) {
$entity = $this->getTestData()->getEntity( $entityName );
$builder = $this->newBuilder( $sites );
diff --git a/repo/tests/phpunit/includes/rdf/TermsRdfBuilderTest.php
b/repo/tests/phpunit/includes/rdf/TermsRdfBuilderTest.php
index 72cac56..da765cc 100644
--- a/repo/tests/phpunit/includes/rdf/TermsRdfBuilderTest.php
+++ b/repo/tests/phpunit/includes/rdf/TermsRdfBuilderTest.php
@@ -43,7 +43,7 @@
*
* @return TermsRdfBuilder
*/
- private function newBuilder( $languages = null ) {
+ private function newBuilder( array $languages = null ) {
$vocabulary = $this->getTestData()->getVocabulary();
$writer = $this->getTestData()->getNTriplesWriter();
@@ -96,7 +96,7 @@
/**
* @dataProvider provideAddEntity
*/
- public function testAddEntity( $entityName, $dataSetName, $languages =
null ) {
+ public function testAddEntity( $entityName, $dataSetName, array
$languages = null ) {
$entity = $this->getTestData()->getEntity( $entityName );
$builder = $this->newBuilder( $languages );
@@ -115,7 +115,7 @@
/**
* @dataProvider provideAddLabels
*/
- public function testAddLabels( $entityName, $dataSetName, $languages =
null ) {
+ public function testAddLabels( $entityName, $dataSetName, array
$languages = null ) {
$entity = $this->getTestData()->getEntity( $entityName );
$builder = $this->newBuilder( $languages );
@@ -134,7 +134,7 @@
/**
* @dataProvider provideAddDescriptions
*/
- public function testAddDescriptions( $entityName, $dataSetName,
$languages = null ) {
+ public function testAddDescriptions( $entityName, $dataSetName, array
$languages = null ) {
$entity = $this->getTestData()->getEntity( $entityName );
$builder = $this->newBuilder( $languages );
@@ -153,7 +153,7 @@
/**
* @dataProvider provideAddAliases
*/
- public function testAddAliases( $entityName, $dataSetName, $languages =
null ) {
+ public function testAddAliases( $entityName, $dataSetName, array
$languages = null ) {
$entity = $this->getTestData()->getEntity( $entityName );
$builder = $this->newBuilder( $languages );
diff --git a/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
b/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
index 5f79dfd..d784767 100644
--- a/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
@@ -142,7 +142,14 @@
* @param int $expCode Expected HTTP status code
* @param array $expHeaders Expected HTTP response headers
*/
- public function testExecute( $subpage, $params, $headers, $expRegExp,
$expCode = 200, $expHeaders = array() ) {
+ public function testExecute(
+ $subpage,
+ array $params,
+ array $headers,
+ $expRegExp,
+ $expCode = 200,
+ array $expHeaders = array()
+ ) {
$request = new FauxRequest( $params );
$request->response()->header( 'Status: 200 OK', true, 200 ); //
init/reset
diff --git a/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
b/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
index c4e91ec..efe2f7d 100644
--- a/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
+++ b/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
@@ -247,7 +247,7 @@
/**
* @param array[] $expectedRows
*/
- private function assertRows( $expectedRows ) {
+ private function assertRows( array $expectedRows ) {
$dbw = wfGetDB( DB_MASTER );
foreach ( $expectedRows as $expectedRow ) {
diff --git
a/repo/tests/phpunit/includes/store/sql/SqlChangeDispatchCoordinatorTest.php
b/repo/tests/phpunit/includes/store/sql/SqlChangeDispatchCoordinatorTest.php
index 4395010..f11e7a1 100644
--- a/repo/tests/phpunit/includes/store/sql/SqlChangeDispatchCoordinatorTest.php
+++ b/repo/tests/phpunit/includes/store/sql/SqlChangeDispatchCoordinatorTest.php
@@ -83,7 +83,7 @@
$dbw->insert( 'wb_changes', $row, __METHOD__ );
}
- private function insertChangesDispatchRows( $rows ) {
+ private function insertChangesDispatchRows( array $rows ) {
$dbw = wfGetDB( DB_MASTER );
$dbw->insert( 'wb_changes_dispatch', array_values( $rows ),
__METHOD__ );
}
@@ -415,7 +415,7 @@
/**
* @dataProvider provideSelectClient
*/
- public function testSelectClient( $chdRows, $expected ) {
+ public function testSelectClient( array $chdRows, $expected ) {
$this->resetChangesTable();
$this->insertChangesDispatchRows( $chdRows );
--
To view, visit https://gerrit.wikimedia.org/r/232690
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibd056718e51491f0b260051c21c54ed95584a673
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits