MediaWiki  REL1_24
ApiQueryAllPagesTest.php
Go to the documentation of this file.
00001 <?php
00002 
00008 class ApiQueryAllPagesTest extends ApiTestCase {
00009 
00010     protected function setUp() {
00011         parent::setUp();
00012         $this->doLogin();
00013     }
00014 
00018     public function testBug25702() {
00019         $title = Title::newFromText( 'Category:Template:xyz' );
00020         $page = WikiPage::factory( $title );
00021         $page->doEdit( 'Some text', 'inserting content' );
00022 
00023         $result = $this->doApiRequest( array(
00024             'action' => 'query',
00025             'list' => 'allpages',
00026             'apnamespace' => NS_CATEGORY,
00027             'apprefix' => 'Template:x' ) );
00028 
00029         $this->assertArrayHasKey( 'query', $result[0] );
00030         $this->assertArrayHasKey( 'allpages', $result[0]['query'] );
00031         $this->assertNotEquals( 0, count( $result[0]['query']['allpages'] ),
00032             'allpages list does not contain page Category:Template:xyz' );
00033     }
00034 }