Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / includes / api / query / ApiQueryContinue2Test.php
blob347cd6f810673143a5bade43875e67cfb79d15bc
1 <?php
2 /**
3 * Copyright © 2013 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
21 require_once 'ApiQueryContinueTestBase.php';
23 /**
24 * @group API
25 * @group Database
26 * @group medium
27 * @covers ApiQuery
29 class ApiQueryContinue2Test extends ApiQueryContinueTestBase {
30 protected $exceptionFromAddDBData;
32 /**
33 * Create a set of pages. These must not change, otherwise the tests might give wrong results.
34 * @see MediaWikiTestCase::addDBData()
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;
49 /**
50 * @medium
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",
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' );