|
MediaWiki
REL1_23
|
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 | |
| 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. | |
Static Private Member Functions | |
| static | sanitizeResultArray ($result) |
| Recursively ksorts a result array and removes any 'pageid' keys. | |
This class has some common functionality for testing query module.
Definition at line 27 of file ApiQueryTestBase.php.
| ApiQueryTestBase::assertResult | ( | $ | exp, |
| $ | result, | ||
| $ | message = '' |
||
| ) | [protected] |
Definition at line 103 of file ApiQueryTestBase.php.
References $e, $result, and sanitizeResultArray().
Referenced by check(), and ApiQueryContinueTestBase\checkC().
| 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 89 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 40 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.
Definition at line 70 of file ApiQueryTestBase.php.
References as.
Referenced by merge().
| static ApiQueryTestBase::sanitizeResultArray | ( | $ | result | ) | [static, private] |
Recursively ksorts a result array and removes any 'pageid' keys.
| array | $result |
Definition at line 131 of file ApiQueryTestBase.php.
References $key, $result, $value, and as.
Referenced by assertResult().
| 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 56 of file ApiQueryTestBase.php.
References MediaWikiTestCase\assertType().