16 'wgSearchType' => MockCompletionSearchEngine::class,
20 foreach ( range( 0, 10 ) as $i ) {
21 $title =
"Search_Result_$i";
23 $this->
editPage( $title,
'hi there' );
30 'no offset' => [ 2, 2, 0, 2 ],
31 'with offset' => [ 7, 2, 5, 2 ],
32 'past end, no offset' => [
null, 11, 0, 20 ],
33 'past end, with offset' => [
null, 5, 6, 10 ],
43 'list' =>
'prefixsearch',
44 'pssearch' => self::TEST_QUERY,
45 'psoffset' => $offset,
49 $this->assertArrayNotHasKey(
'warnings', $result );
50 $suggestions = $result[
'query'][
'prefixsearch'];
51 $this->assertCount( $expectedResults, $suggestions );
52 if ( $expectedOffset ==
null ) {
53 $this->assertArrayNotHasKey(
'continue', $result );
55 $this->assertArrayHasKey(
'continue', $result );
56 $this->assertEquals( $expectedOffset, $result[
'continue'][
'psoffset'] );
testOffsetContinue( $expectedOffset, $expectedResults, $offset, $limit)
offsetContinueProvider
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
Does the API request and returns the result.
static addMockResults( $query, array $result)
Allows returning arbitrary lists of titles for completion search.
static clearMockResults()
Reset any mocked results.
namespace and then decline to actually register it file or subcat img or subcat $title
this hook is for auditing only $response