Merge "Remove use of BagOStuff TTL constants from unrelated code"
[mediawiki.git] / tests / phpunit / includes / api / query / ApiQueryAllPagesTest.php
blob100f5cd3ae793dbef38629ac3d0613c6477c7dfb
1 <?php
3 namespace MediaWiki\Tests\Api\Query;
5 use MediaWiki\Tests\Api\ApiTestCase;
6 use MediaWiki\Title\Title;
8 /**
9 * @group API
10 * @group Database
11 * @group medium
13 * @covers \MediaWiki\Api\ApiQueryAllPages
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
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()
31 $result = $this->doApiRequest( [
32 'action' => 'query',
33 'list' => 'allpages',
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] );