MediaWiki REL1_31
ApiQueryAllPagesTest.php
Go to the documentation of this file.
1<?php
2
17 $title = Title::newFromText( 'Category:Template:xyz' );
18 $page = WikiPage::factory( $title );
19
20 $page->doEditContent(
21 ContentHandler::makeContent( 'Some text', $page->getTitle() ),
22 'inserting content'
23 );
24
25 $result = $this->doApiRequest( [
26 'action' => 'query',
27 'list' => 'allpages',
28 'apnamespace' => NS_CATEGORY,
29 'apprefix' => 'Template:x' ] );
30
31 $this->assertArrayHasKey( 'query', $result[0] );
32 $this->assertArrayHasKey( 'allpages', $result[0]['query'] );
33 $this->assertNotEquals( 0, count( $result[0]['query']['allpages'] ),
34 'allpages list does not contain page Category:Template:xyz' );
35 }
36}
testPrefixNormalizationSearchBug()
Test T27702 Prefixes of API search requests are not handled with case sensitivity and may result in w...
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
Does the API request and returns the result.
const NS_CATEGORY
Definition Defines.php:88