MediaWiki  REL1_21
ApiQueryContinue2Test.php
Go to the documentation of this file.
00001 <?php
00021 require_once( 'ApiQueryContinueTestBase.php' );
00022 
00028 class ApiQueryContinue2Test extends ApiQueryContinueTestBase {
00033         function addDBData() {
00034                 try {
00035                         $this->editPage( 'AQCT73462-A', '**AQCT73462-A**  [[AQCT73462-B]] [[AQCT73462-C]]' );
00036                         $this->editPage( 'AQCT73462-B', '[[AQCT73462-A]]  **AQCT73462-B** [[AQCT73462-C]]' );
00037                         $this->editPage( 'AQCT73462-C', '[[AQCT73462-A]]  [[AQCT73462-B]] **AQCT73462-C**' );
00038                         $this->editPage( 'AQCT73462-A', '**AQCT73462-A**  [[AQCT73462-B]] [[AQCT73462-C]]' );
00039                         $this->editPage( 'AQCT73462-B', '[[AQCT73462-A]]  **AQCT73462-B** [[AQCT73462-C]]' );
00040                         $this->editPage( 'AQCT73462-C', '[[AQCT73462-A]]  [[AQCT73462-B]] **AQCT73462-C**' );
00041                 } catch ( Exception $e ) {
00042                         $this->exceptionFromAddDBData = $e;
00043                 }
00044         }
00045 
00049         public function testA() {
00050                 $this->mVerbose = false;
00051                 $mk = function( $g, $p, $gDir ) {
00052                         return array(
00053                                 'generator' => 'allpages',
00054                                 'gapprefix' => 'AQCT73462-',
00055                                 'prop' => 'links',
00056                                 'gaplimit' => "$g",
00057                                 'pllimit' => "$p",
00058                                 'gapdir' => $gDir ? "ascending" : "descending",
00059                         );
00060                 };
00061                 // generator + 1 prop + 1 list
00062                 $data = $this->query( $mk(99,99,true), 1, 'g1p', false );
00063                 $this->checkC( $data, $mk(1,1,true), 6, 'g1p-11t' );
00064                 $this->checkC( $data, $mk(2,2,true), 3, 'g1p-22t' );
00065                 $this->checkC( $data, $mk(1,1,false), 6, 'g1p-11f' );
00066                 $this->checkC( $data, $mk(2,2,false), 3, 'g1p-22f' );
00067         }
00068 }