MediaWiki
REL1_22
|
This class has some common functionality for testing query module. More...
Public Attributes | |
const | PARAM_ASSERT |
Protected Member Functions | |
assertResult ($exp, $result, $message= '') | |
check ($values) | |
Checks that the request's result matches the expected results. | |
merge () | |
Merges all requests parameter + expected values into one. | |
Private Member Functions | |
assertResultRecursive ($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. | |
validateRequestExpectedPair ($v) | |
Check that the parameter is a valid two element array, with the first element being API request and the second - expected result. |
This class has some common functionality for testing query module.
Definition at line 29 of file ApiQueryTestBase.php.
ApiQueryTestBase::assertResult | ( | $ | exp, |
$ | result, | ||
$ | message = '' |
||
) | [protected] |
Definition at line 105 of file ApiQueryTestBase.php.
References $result, assertResultRecursive(), and print.
Referenced by check(), and ApiQueryContinueTestBase\checkC().
ApiQueryTestBase::assertResultRecursive | ( | $ | expected, |
$ | result | ||
) | [private] |
Recursively compare arrays, ignoring mismatches in numeric key and pageids.
$expected | array expected values |
$result | array returned values |
Definition at line 126 of file ApiQueryTestBase.php.
References $result.
Referenced by assertResult().
ApiQueryTestBase::check | ( | $ | values | ) | [protected] |
Checks that the request's result matches the expected results.
$values | array is a two element array( request, expected_results ) |
Exception |
Definition at line 91 of file ApiQueryTestBase.php.
References $result, array(), as, assertResult(), ApiTestCase\doApiRequest(), list, and validateRequestExpectedPair().
Referenced by ApiQueryBasicTest\testAllTogether(), ApiQueryBasicTest\testGenerator(), ApiQueryBasicTest\testGeneratorRedirects(), ApiQueryBasicTest\testLists(), and ApiQueryBasicTest\testProps().
ApiQueryTestBase::merge | ( | ) | [protected] |
Merges all requests parameter + expected values into one.
... | list of arrays, each of which contains exactly two |
Definition at line 42 of file ApiQueryTestBase.php.
References array(), as, list, mergeExpected(), and validateRequestExpectedPair().
Referenced by ApiQueryBasicTest\testAllTogether(), and ApiQueryBasicTest\testGenerator().
ApiQueryTestBase::mergeExpected | ( | &$ | all, |
$ | item | ||
) | [private] |
Recursively merges the expected values in the $item into the $all.
Reimplemented in ApiQueryBasicTest.
Definition at line 72 of file ApiQueryTestBase.php.
References as.
Referenced by merge().
ApiQueryTestBase::validateRequestExpectedPair | ( | $ | v | ) | [private] |
Check that the parameter is a valid two element array, with the first element being API request and the second - expected result.
Definition at line 58 of file ApiQueryTestBase.php.
References MediaWikiTestCase\assertType().