Debian Codegraph @

tests/phpunit/includes/api/query/ApiQueryAllPagesTest.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Tests\Api\Query;
4
5 use MediaWiki\Tests\Api\ApiTestCase;
6 use MediaWiki\Title\Title;
7
8 /**
9 * @group API
10 * @group Database
11 * @group medium
12 *
13 * @covers MediaWiki\Api\ApiQueryAllPages
14 */
15 class ApiQueryAllPagesTest extends ApiTestCase {
16 /**
17 * Test T27702
18 * Prefixes of API search requests are not handled with case sensitivity and may result
19 * in wrong search results
20 */
21 public function testPrefixNormalizationSearchBug() {
22 $title = Title::makeTitle( NS_CATEGORY, 'Template:xyz' );
23 $this->editPage(
24 $title,
25 'Some text',
26 'inserting content',
27 NS_MAIN,
28 $this->getTestSysop()->getAuthority()
29 );
30
31 $result = $this->doApiRequest( [
32 'action' => 'query',
33 'list' => 'allpages',
34 'apnamespace' => NS_CATEGORY,
35 'apprefix' => 'Template:x' ] );
36
37 $this->assertArrayHasKey( 'query', $result[0] );
38 $this->assertArrayHasKey( 'allpages', $result[0]['query'] );
39 $this->assertContains( 'Category:Template:xyz', $result[0]['query']['allpages'][0] );
40 }
41 }