MediaWiki REL1_30
ApiQueryAllPagesTest.php
Go to the documentation of this file.
1<?php
2
9
10 protected function setUp() {
11 parent::setUp();
12 $this->doLogin();
13 }
14
21 $title = Title::newFromText( 'Category:Template:xyz' );
22 $page = WikiPage::factory( $title );
23
24 $page->doEditContent(
25 ContentHandler::makeContent( 'Some text', $page->getTitle() ),
26 'inserting content'
27 );
28
29 $result = $this->doApiRequest( [
30 'action' => 'query',
31 'list' => 'allpages',
32 'apnamespace' => NS_CATEGORY,
33 'apprefix' => 'Template:x' ] );
34
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' );
39 }
40}
API Database medium.
testPrefixNormalizationSearchBug()
Test T27702 Prefixes of API search requests are not handled with case sensitivity and may result in w...
doLogin( $testUser='sysop')
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null)
Does the API request and returns the result.
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
Definition WikiPage.php:121
const NS_CATEGORY
Definition Defines.php:79