MediaWiki
REL1_22
|
These tests validate basic functionality of the api query module. More...
Public Member Functions | |
addDBData () | |
Create a set of pages. | |
testAllTogether () | |
Test basic lists. | |
testGenerator () | |
Test basic lists. | |
testGeneratorRedirects () | |
Test bug 51821. | |
testLists () | |
Test basic lists. | |
testProps () | |
Test basic props. | |
Private Member Functions | |
assertQueryResults ($expected, $result) | |
Recursively compare arrays, ignoring mismatches in numeric key and pageids. | |
mergeExpected (&$all, $item) | |
Recursively merges the expected values in the $item into the $all. | |
Static Private Attributes | |
static | $allcategories |
static | $alllinks |
static | $allpages |
static | $alltransclusions |
static | $backlinks |
static | $categories |
static | $categorymembers |
static | $embeddedin |
static | $generatorAllpages |
static | $generatorLinks |
static | $generatorLinksPropLinks |
static | $generatorLinksPropTemplates |
static | $links |
static | $templates |
These tests validate basic functionality of the api query module.
API Database medium
Definition at line 35 of file ApiQueryBasicTest.php.
Create a set of pages.
These must not change, otherwise the tests might give wrong results.
Reimplemented from MediaWikiTestCase.
Definition at line 40 of file ApiQueryBasicTest.php.
References ApiTestCase\editPage(), and Title\newFromText().
ApiQueryBasicTest::assertQueryResults | ( | $ | expected, |
$ | result | ||
) | [private] |
Recursively compare arrays, ignoring mismatches in numeric key and pageids.
$expected | array expected values |
$result | array returned values |
Definition at line 371 of file ApiQueryBasicTest.php.
References $result.
ApiQueryBasicTest::mergeExpected | ( | &$ | all, |
$ | item | ||
) | [private] |
Recursively merges the expected values in the $item into the $all.
Reimplemented from ApiQueryTestBase.
Definition at line 352 of file ApiQueryBasicTest.php.
References as.
Test basic lists.
Definition at line 246 of file ApiQueryBasicTest.php.
References ApiQueryTestBase\check(), and ApiQueryTestBase\merge().
Test basic lists.
Definition at line 286 of file ApiQueryBasicTest.php.
References ApiQueryTestBase\check(), and ApiQueryTestBase\merge().
Test bug 51821.
Definition at line 326 of file ApiQueryBasicTest.php.
References array(), ApiQueryTestBase\check(), and ApiTestCase\editPage().
Test basic lists.
Definition at line 232 of file ApiQueryBasicTest.php.
References ApiQueryTestBase\check().
Test basic props.
Definition at line 223 of file ApiQueryBasicTest.php.
References ApiQueryTestBase\check().
ApiQueryBasicTest::$allcategories [static, private] |
ApiQueryBasicTest::$alllinks [static, private] |
array( array( 'list' => 'alllinks', 'alprefix' => 'AQBT-' ), array( 'alllinks' => array( array( 'ns' => 0, 'title' => 'AQBT-All' ), array( 'ns' => 0, 'title' => 'AQBT-Categories' ), array( 'ns' => 0, 'title' => 'AQBT-Links' ), array( 'ns' => 0, 'title' => 'AQBT-Templates' ), ) ) )
Definition at line 113 of file ApiQueryBasicTest.php.
ApiQueryBasicTest::$allpages [static, private] |
array( array( 'list' => 'allpages', 'apprefix' => 'AQBT-' ), array( 'allpages' => array( array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), array( 'pageid' => 2, 'ns' => 0, 'title' => 'AQBT-Categories' ), array( 'pageid' => 3, 'ns' => 0, 'title' => 'AQBT-Links' ), array( 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), ) ) )
Definition at line 103 of file ApiQueryBasicTest.php.
ApiQueryBasicTest::$alltransclusions [static, private] |
ApiQueryBasicTest::$backlinks [static, private] |
ApiQueryBasicTest::$categories [static, private] |
array( array( 'prop' => 'categories', 'titles' => 'AQBT-All' ), array( 'pages' => array( '1' => array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All', 'categories' => array( array( 'ns' => 14, 'title' => 'Category:AQBT-Cat' ), ) ) ) ) )
Definition at line 89 of file ApiQueryBasicTest.php.
ApiQueryBasicTest::$categorymembers [static, private] |
array( array( 'list' => 'categorymembers', 'cmtitle' => 'Category:AQBT-Cat' ), array( 'categorymembers' => array( array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), array( 'pageid' => 2, 'ns' => 0, 'title' => 'AQBT-Categories' ), ) ) )
Definition at line 153 of file ApiQueryBasicTest.php.
ApiQueryBasicTest::$embeddedin [static, private] |
ApiQueryBasicTest::$generatorAllpages [static, private] |
array( array( 'generator' => 'allpages', 'gapprefix' => 'AQBT-' ), array( 'pages' => array( '1' => array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), '2' => array( 'pageid' => 2, 'ns' => 0, 'title' => 'AQBT-Categories' ), '3' => array( 'pageid' => 3, 'ns' => 0, 'title' => 'AQBT-Links' ), '4' => array( 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), ) ) )
Definition at line 161 of file ApiQueryBasicTest.php.
ApiQueryBasicTest::$generatorLinks [static, private] |
array( array( 'generator' => 'links', 'titles' => 'AQBT-Links' ), array( 'pages' => array( '1' => array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), '2' => array( 'pageid' => 2, 'ns' => 0, 'title' => 'AQBT-Categories' ), '4' => array( 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), ) ) )
Definition at line 183 of file ApiQueryBasicTest.php.
ApiQueryBasicTest::$generatorLinksPropLinks [static, private] |
ApiQueryBasicTest::$generatorLinksPropTemplates [static, private] |
array( array( 'prop' => 'templates' ), array( 'pages' => array( '1' => array( 'templates' => array( array( 'ns' => 10, 'title' => 'Template:AQBT-T' ) ) ), '4' => array( 'templates' => array( array( 'ns' => 10, 'title' => 'Template:AQBT-T' ) ) ), ) ) )
Definition at line 210 of file ApiQueryBasicTest.php.
ApiQueryBasicTest::$links [static, private] |
ApiQueryBasicTest::$templates [static, private] |
array( array( 'prop' => 'templates', 'titles' => 'AQBT-All' ), array( 'pages' => array( '1' => array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All', 'templates' => array( array( 'ns' => 10, 'title' => 'Template:AQBT-T' ), ) ) ) ) )
Definition at line 75 of file ApiQueryBasicTest.php.