MediaWiki REL1_31
ApiQueryContinue2Test.php
Go to the documentation of this file.
1<?php
29
35 function addDBDataOnce() {
36 try {
37 $this->editPage( 'AQCT73462-A', '**AQCT73462-A** [[AQCT73462-B]] [[AQCT73462-C]]' );
38 $this->editPage( 'AQCT73462-B', '[[AQCT73462-A]] **AQCT73462-B** [[AQCT73462-C]]' );
39 $this->editPage( 'AQCT73462-C', '[[AQCT73462-A]] [[AQCT73462-B]] **AQCT73462-C**' );
40 $this->editPage( 'AQCT73462-A', '**AQCT73462-A** [[AQCT73462-B]] [[AQCT73462-C]]' );
41 $this->editPage( 'AQCT73462-B', '[[AQCT73462-A]] **AQCT73462-B** [[AQCT73462-C]]' );
42 $this->editPage( 'AQCT73462-C', '[[AQCT73462-A]] [[AQCT73462-B]] **AQCT73462-C**' );
43 } catch ( Exception $e ) {
44 $this->exceptionFromAddDBData = $e;
45 }
46 }
47
51 public function testA() {
52 $this->mVerbose = false;
53 $mk = function ( $g, $p, $gDir ) {
54 return [
55 'generator' => 'allpages',
56 'gapprefix' => 'AQCT73462-',
57 'prop' => 'links',
58 'gaplimit' => "$g",
59 'pllimit' => "$p",
60 'gapdir' => $gDir ? "ascending" : "descending",
61 ];
62 };
63 // generator + 1 prop + 1 list
64 $data = $this->query( $mk( 99, 99, true ), 1, 'g1p', false ) +
65 [ 'batchcomplete' => true ];
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}
Copyright © 2013 Yuri Astrakhan "<Firstname><Lastname>@gmail.com".
checkC( $expected, $params, $expectedCount, $id, $continue=true)
Run query() and compare against expected values.
editPage( $pageName, $text, $summary='', $defaultNs=NS_MAIN)
Edits or creates a page/revision.
For a write query
Definition database.txt:26
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Definition hooks.txt:2006
returning false will NOT prevent logging $e
Definition hooks.txt:2176