MediaWiki  master
ApiQueryBasicTest Class Reference

These tests validate basic functionality of the api query module. More...

Inheritance diagram for ApiQueryBasicTest:
Collaboration diagram for ApiQueryBasicTest:

Public Member Functions

 addDBDataOnce ()
 Create a set of pages. More...
 
 testAllTogether ()
 Test basic lists. More...
 
 testGenerator ()
 Test basic lists. More...
 
 testGeneratorRedirects ()
 Test T53821. More...
 
 testLists ()
 Test basic lists. More...
 
static static testProps ()
 Test basic props. More...
 
- Public Member Functions inherited from ApiTestCase
 testApiTestGroup ()
 

Protected Attributes

 $exceptionFromAddDBData
 
- Protected Attributes inherited from ApiTestCase
ApiTestContext $apiContext
 

Static Private Attributes

static static static static $allcategories
 
static static $alllinks
 
static $allpages
 
static static static $alltransclusions
 
static $backlinks
 
static $categories
 
static static static $categorymembers
 
static static $embeddedin
 
static static static static $generatorAllpages
 
static $generatorLinks
 
static $generatorLinksPropLinks
 
static static $generatorLinksPropTemplates
 
static $links
 
static $templates
 

Additional Inherited Members

- Static Public Member Functions inherited from ApiTestCase
static apiExceptionHasCode (ApiUsageException $ex, $code)
 
- Public Attributes inherited from ApiQueryTestBase
const PARAM_ASSERT
 
- Protected Member Functions inherited from ApiQueryTestBase
 assertResult ( $exp, $result, $message='')
 
 check ( $values, array $session=null, $appendModule=false, User $user=null)
 Checks that the request's result matches the expected results. More...
 
 merge (... $arrays)
 Merges all requests parameter + expected values into one. More...
 
- Protected Member Functions inherited from ApiTestCase
 doApiRequest (array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
 Does the API request and returns the result. More...
 
 doApiRequestWithToken (array $params, array $session=null, User $user=null, $tokenType='auto')
 Convenience function to access the token parameter of doApiRequest() more succinctly. More...
 
 doLogin ( $testUser=null)
 Previously this would do API requests to log in, as well as setting $wgUser and the request context's user. More...
 
 getTokenList (TestUser $user, $session=null)
 
 setExpectedApiException ( $msg, $code=null, array $data=null, $httpCode=0)
 Expect an ApiUsageException to be thrown with the given parameters, which are the same as ApiUsageException::newWithMessage()'s parameters. More...
 
 setUp ()
 
 tearDown ()
 
- Protected Member Functions inherited from MediaWikiLangTestCase
 setUp ()
 
- Static Protected Member Functions inherited from ApiTestCase
static getErrorFormatter ()
 
- Static Protected Attributes inherited from ApiTestCase
static $apiUrl
 
static $errorFormatter = null
 

Detailed Description

These tests validate basic functionality of the api query module.

API Database medium ApiQuery

Definition at line 31 of file ApiQueryBasicTest.php.

Member Function Documentation

◆ addDBDataOnce()

ApiQueryBasicTest::addDBDataOnce ( )

Create a set of pages.

These must not change, otherwise the tests might give wrong results.

See also
MediaWikiTestCase::addDBDataOnce()

Definition at line 39 of file ApiQueryBasicTest.php.

References $e, Title\newFromText(), and NS_TEMPLATE.

◆ testAllTogether()

ApiQueryBasicTest::testAllTogether ( )

Test basic lists.

Definition at line 245 of file ApiQueryBasicTest.php.

References ApiQueryTestBase\check(), and ApiQueryTestBase\merge().

◆ testGenerator()

ApiQueryBasicTest::testGenerator ( )

Test basic lists.

Definition at line 284 of file ApiQueryBasicTest.php.

References ApiQueryTestBase\check(), and ApiQueryTestBase\merge().

◆ testGeneratorRedirects()

ApiQueryBasicTest::testGeneratorRedirects ( )

Test T53821.

Definition at line 324 of file ApiQueryBasicTest.php.

References ApiQueryTestBase\check().

◆ testLists()

ApiQueryBasicTest::testLists ( )

Test basic lists.

Definition at line 232 of file ApiQueryBasicTest.php.

References ApiQueryTestBase\check().

◆ testProps()

static static ApiQueryBasicTest::testProps ( )

Test basic props.

Definition at line 223 of file ApiQueryBasicTest.php.

References ApiQueryTestBase\check().

Member Data Documentation

◆ $allcategories

static static static ApiQueryBasicTest::$allcategories
staticprivate
Initial value:
= [
[ 'list' => 'allcategories', 'acprefix' => 'AQBT-' ],
[ 'allcategories' => [
[ 'category' => 'AQBT-Cat' ],
] ]
]

Definition at line 131 of file ApiQueryBasicTest.php.

◆ $alllinks

static ApiQueryBasicTest::$alllinks
staticprivate
Initial value:
= [
[ 'list' => 'alllinks', 'alprefix' => 'AQBT-' ],
[ 'alllinks' => [
[ 'ns' => 0

Definition at line 112 of file ApiQueryBasicTest.php.

◆ $allpages

ApiQueryBasicTest::$allpages
staticprivate
Initial value:
= [
[ 'list' => 'allpages', 'apprefix' => 'AQBT-' ],
[ 'allpages' => [
[ 'pageid' => 1

Definition at line 102 of file ApiQueryBasicTest.php.

◆ $alltransclusions

static static ApiQueryBasicTest::$alltransclusions
staticprivate
Initial value:
= [
[ 'list' => 'alltransclusions', 'atprefix' => 'AQBT-' ],
[ 'alltransclusions' => [
[ 'ns' => 10

Definition at line 122 of file ApiQueryBasicTest.php.

◆ $backlinks

ApiQueryBasicTest::$backlinks
staticprivate
Initial value:
= [
[ 'list' => 'backlinks', 'bltitle' => 'AQBT-Links' ],
[ 'backlinks' => [
[ 'pageid' => 1

Definition at line 138 of file ApiQueryBasicTest.php.

◆ $categories

ApiQueryBasicTest::$categories
staticprivate
Initial value:
= [
[ 'prop' => 'categories', 'titles' => 'AQBT-All' ],
[ 'pages' => [
'1' => [
'pageid' => 1,
'ns' => 0,
'title' => 'AQBT-All',
'categories' => [
[ 'ns' => 14, 'title' => 'Category:AQBT-Cat' ],
]
]
] ]
]

Definition at line 88 of file ApiQueryBasicTest.php.

◆ $categorymembers

static static ApiQueryBasicTest::$categorymembers
staticprivate
Initial value:
= [
[ 'list' => 'categorymembers', 'cmtitle' => 'Category:AQBT-Cat' ],
[ 'categorymembers' => [
[ 'pageid' => 1

Definition at line 153 of file ApiQueryBasicTest.php.

◆ $embeddedin

static ApiQueryBasicTest::$embeddedin
staticprivate
Initial value:
= [
[ 'list' => 'embeddedin', 'eititle' => 'Template:AQBT-T' ],
[ 'embeddedin' => [
[ 'pageid' => 1

Definition at line 145 of file ApiQueryBasicTest.php.

◆ $exceptionFromAddDBData

ApiQueryBasicTest::$exceptionFromAddDBData
protected

Definition at line 32 of file ApiQueryBasicTest.php.

◆ $generatorAllpages

static static static ApiQueryBasicTest::$generatorAllpages
staticprivate
Initial value:
= [
[ 'generator' => 'allpages', 'gapprefix' => 'AQBT-' ],
[ 'pages' => [
'1' => [
'pageid' => 1,
'ns' => 0,
'title' => 'AQBT-All' ],
'2' => [
'pageid' => 2,
'ns' => 0,
'title' => 'AQBT-Categories' ],
'3' => [
'pageid' => 3,
'ns' => 0,
'title' => 'AQBT-Links' ],
'4' => [
'pageid' => 4,
'ns' => 0,
'title' => 'AQBT-Templates' ],
] ]
]

Definition at line 161 of file ApiQueryBasicTest.php.

◆ $generatorLinks

ApiQueryBasicTest::$generatorLinks
staticprivate
Initial value:
= [
[ 'generator' => 'links', 'titles' => 'AQBT-Links' ],
[ 'pages' => [
'1' => [
'pageid' => 1,
'ns' => 0,
'title' => 'AQBT-All' ],
'2' => [
'pageid' => 2,
'ns' => 0,
'title' => 'AQBT-Categories' ],
'4' => [
'pageid' => 4,
'ns' => 0,
'title' => 'AQBT-Templates' ],
] ]
]

Definition at line 183 of file ApiQueryBasicTest.php.

◆ $generatorLinksPropLinks

ApiQueryBasicTest::$generatorLinksPropLinks
staticprivate
Initial value:
= [
[ 'prop' => 'links' ]

Definition at line 201 of file ApiQueryBasicTest.php.

◆ $generatorLinksPropTemplates

static ApiQueryBasicTest::$generatorLinksPropTemplates
staticprivate
Initial value:
= [
[ 'prop' => 'templates' ]

Definition at line 210 of file ApiQueryBasicTest.php.

◆ $links

ApiQueryBasicTest::$links
staticprivate
Initial value:
= [
[ 'prop' => 'links', 'titles' => 'AQBT-All' ],
[ 'pages' => [
'1' => [
'pageid' => 1,
'ns' => 0,
'title' => 'AQBT-All',
'links' => [
[ 'ns' => 0, 'title' => 'AQBT-Links' ],
]
]
] ]
]

Definition at line 60 of file ApiQueryBasicTest.php.

◆ $templates

ApiQueryBasicTest::$templates
staticprivate
Initial value:
= [
[ 'prop' => 'templates', 'titles' => 'AQBT-All' ],
[ 'pages' => [
'1' => [
'pageid' => 1,
'ns' => 0,
'title' => 'AQBT-All',
'templates' => [
[ 'ns' => 10, 'title' => 'Template:AQBT-T' ],
]
]
] ]
]

Definition at line 74 of file ApiQueryBasicTest.php.


The documentation for this class was generated from the following file: