Move ResultWrapper subclasses to Rdbms
[mediawiki.git] / tests / phpunit / includes / api / ApiQueryAllPagesTest.php
blob9f28aaf56eefd6d6654e592102f5189bb3743919
1 <?php
3 /**
4 * @group API
5 * @group Database
6 * @group medium
7 */
8 class ApiQueryAllPagesTest extends ApiTestCase {
10 protected function setUp() {
11 parent::setUp();
12 $this->doLogin();
15 /**
16 *Test T27702
17 *Prefixes of API search requests are not handled with case sensitivity and may result
18 *in wrong search results
20 public function testPrefixNormalizationSearchBug() {
21 $title = Title::newFromText( 'Category:Template:xyz' );
22 $page = WikiPage::factory( $title );
24 $page->doEditContent(
25 ContentHandler::makeContent( 'Some text', $page->getTitle() ),
26 'inserting content'
29 $result = $this->doApiRequest( [
30 'action' => 'query',
31 'list' => 'allpages',
32 'apnamespace' => NS_CATEGORY,
33 'apprefix' => 'Template:x' ] );
35 $this->assertArrayHasKey( 'query', $result[0] );
36 $this->assertArrayHasKey( 'allpages', $result[0]['query'] );
37 $this->assertNotEquals( 0, count( $result[0]['query']['allpages'] ),
38 'allpages list does not contain page Category:Template:xyz' );