3 namespace MediaWiki\Tests\Api\Query
;
5 use MediaWiki\Tests\Api\ApiTestCase
;
6 use MediaWiki\Title\Title
;
13 * @covers \MediaWiki\Api\ApiQueryAllPages
15 class ApiQueryAllPagesTest
extends ApiTestCase
{
18 * Prefixes of API search requests are not handled with case sensitivity and may result
19 * in wrong search results
21 public function testPrefixNormalizationSearchBug() {
22 $title = Title
::makeTitle( NS_CATEGORY
, 'Template:xyz' );
28 $this->getTestSysop()->getAuthority()
31 $result = $this->doApiRequest( [
34 'apnamespace' => NS_CATEGORY
,
35 'apprefix' => 'Template:x' ] );
37 $this->assertArrayHasKey( 'query', $result[0] );
38 $this->assertArrayHasKey( 'allpages', $result[0]['query'] );
39 $this->assertContains( 'Category:Template:xyz', $result[0]['query']['allpages'][0] );