MediaWiki  1.23.15
ApiQueryContinue2Test.php
Go to the documentation of this file.
1 <?php
21 require_once 'ApiQueryContinueTestBase.php';
22 
31 
36  function addDBData() {
37  try {
38  $this->editPage( 'AQCT73462-A', '**AQCT73462-A** [[AQCT73462-B]] [[AQCT73462-C]]' );
39  $this->editPage( 'AQCT73462-B', '[[AQCT73462-A]] **AQCT73462-B** [[AQCT73462-C]]' );
40  $this->editPage( 'AQCT73462-C', '[[AQCT73462-A]] [[AQCT73462-B]] **AQCT73462-C**' );
41  $this->editPage( 'AQCT73462-A', '**AQCT73462-A** [[AQCT73462-B]] [[AQCT73462-C]]' );
42  $this->editPage( 'AQCT73462-B', '[[AQCT73462-A]] **AQCT73462-B** [[AQCT73462-C]]' );
43  $this->editPage( 'AQCT73462-C', '[[AQCT73462-A]] [[AQCT73462-B]] **AQCT73462-C**' );
44  } catch ( Exception $e ) {
45  $this->exceptionFromAddDBData = $e;
46  }
47  }
48 
52  public function testA() {
53  $this->mVerbose = false;
54  $mk = function ( $g, $p, $gDir ) {
55  return array(
56  'generator' => 'allpages',
57  'gapprefix' => 'AQCT73462-',
58  'prop' => 'links',
59  'gaplimit' => "$g",
60  'pllimit' => "$p",
61  'gapdir' => $gDir ? "ascending" : "descending",
62  );
63  };
64  // generator + 1 prop + 1 list
65  $data = $this->query( $mk( 99, 99, true ), 1, 'g1p', false );
66  $this->checkC( $data, $mk( 1, 1, true ), 6, 'g1p-11t' );
67  $this->checkC( $data, $mk( 2, 2, true ), 3, 'g1p-22t' );
68  $this->checkC( $data, $mk( 1, 1, false ), 6, 'g1p-11f' );
69  $this->checkC( $data, $mk( 2, 2, false ), 3, 'g1p-22f' );
70  }
71 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
ApiQueryContinue2Test\addDBData
addDBData()
Create a set of pages.
Definition: ApiQueryContinue2Test.php:36
ApiQueryContinue2Test\$exceptionFromAddDBData
$exceptionFromAddDBData
Definition: ApiQueryContinue2Test.php:30
ApiQueryContinue2Test\testA
testA()
@medium
Definition: ApiQueryContinue2Test.php:52
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ApiQueryContinueTestBase\checkC
checkC( $expected, $params, $expectedCount, $id, $continue=true)
Run query() and compare against expected values.
Definition: ApiQueryContinueTestBase.php:37
ApiTestCase\editPage
editPage( $pageName, $text, $summary='', $defaultNs=NS_MAIN)
Edits or creates a page/revision.
Definition: ApiTestCase.php:51
ApiQueryContinue2Test
Copyright © 2013 Yuri Astrakhan "<Firstname><Lastname>@gmail.com".
Definition: ApiQueryContinue2Test.php:29
ApiQueryContinueTestBase
Definition: ApiQueryContinueTestBase.php:27
ApiQueryContinueTestBase\query
query( $params, $expectedCount, $id, $useContinue=true)
Run query in a loop until no more values are available.
Definition: ApiQueryContinueTestBase.php:51
$e
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
Definition: hooks.txt:1632