@@ -56,6 +56,9 @@ discard block |
||
56 | 56 | return new ApiEntitySearchHelper( $api, $dataTypes ); |
57 | 57 | } |
58 | 58 | |
59 | + /** |
|
60 | + * @param string $responseDataFile |
|
61 | + */ |
|
59 | 62 | private function setupTestApi( &$params, $langCode, $responseDataFile, $statusCode = 200 ) { |
60 | 63 | $params = array_merge( $params, [ 'language' => $langCode, 'uselang' => $langCode, 'format' => 'json' ] ); |
61 | 64 | $api = $this->createMock( GenericActionApiClient::class ); |
@@ -152,8 +155,8 @@ discard block |
||
152 | 155 | /** |
153 | 156 | * @dataProvider paramsAndExpectedResponseProvider |
154 | 157 | * @param string $responseDataFile |
155 | - * @param int $expectedResultCount |
|
156 | - * @param array $expectedResultsEntityId |
|
158 | + * @param int $expectedResultsEntityIds |
|
159 | + * @param array $expectedResultsEntityIds |
|
157 | 160 | * @throws ApiRequestException |
158 | 161 | */ |
159 | 162 | public function testGetRankedSearchResults( $langCode, $params, $responseDataFile, $expectedResultsEntityIds ) { |
@@ -220,6 +223,9 @@ discard block |
||
220 | 223 | } |
221 | 224 | } |
222 | 225 | |
226 | + /** |
|
227 | + * @return string |
|
228 | + */ |
|
223 | 229 | private function getResponseDataForId( array $searchResponses, $resultId ) { |
224 | 230 | $searchResponses = array_filter( $searchResponses, function ( $response ) use ( $resultId ) { |
225 | 231 | return $response->id === $resultId; |
@@ -233,8 +239,6 @@ discard block |
||
233 | 239 | /** |
234 | 240 | * @dataProvider invalidParamsAndUnexpectedResponseProvider |
235 | 241 | * @param string $responseDataFile |
236 | - * @param int $expectedResultCount |
|
237 | - * @param array $expectedResultsEntityId |
|
238 | 242 | */ |
239 | 243 | public function testApiResponseStructureIsValid( $langCode, $params, $responseDataFile, $statusCode ) { |
240 | 244 | $api = $this->setupTestApi( $params, $langCode, $responseDataFile, $statusCode ); |
@@ -133,6 +133,9 @@ |
||
133 | 133 | return $this->getFromBuffer( $entityId, TermTypes::TYPE_ALIAS, $languageCode ) ?? false; |
134 | 134 | } |
135 | 135 | |
136 | + /** |
|
137 | + * @param string $languageCode |
|
138 | + */ |
|
136 | 139 | private function getFromBuffer( EntityId $entityId, $termType, $languageCode ) { |
137 | 140 | if ( !( $entityId instanceof Int32EntityId ) ) { |
138 | 141 | throw new InvalidArgumentException( "Not an Int32EntityId: " . $entityId->getSerialization() ); |
@@ -14,6 +14,7 @@ |
||
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Some test appear to want to simulate null status codes, hence the type hint |
17 | + * @param integer $statusCode |
|
17 | 18 | */ |
18 | 19 | private function newMockResponse( $response, ?int $statusCode ): ResponseInterface { |
19 | 20 | $mockStream = $this->createMock( StreamInterface::class ); |
@@ -56,6 +56,9 @@ |
||
56 | 56 | ]; |
57 | 57 | } |
58 | 58 | |
59 | + /** |
|
60 | + * @param integer $revision |
|
61 | + */ |
|
59 | 62 | protected function resolveLogicalRevision( $revision ) { |
60 | 63 | return $revision; |
61 | 64 | } |
@@ -355,7 +355,7 @@ |
||
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
358 | - * @param iterable<PageEntityUsages> $usages |
|
358 | + * @param Traversable $usages |
|
359 | 359 | * @param EntityId $entityId |
360 | 360 | * @param string[] $changedAspects |
361 | 361 | * |