summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/api/query/ApiQueryTestBase.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /tests/phpunit/includes/api/query/ApiQueryTestBase.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'tests/phpunit/includes/api/query/ApiQueryTestBase.php')
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryTestBase.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/phpunit/includes/api/query/ApiQueryTestBase.php b/tests/phpunit/includes/api/query/ApiQueryTestBase.php
index dabf72e0..d5fa4542 100644
--- a/tests/phpunit/includes/api/query/ApiQueryTestBase.php
+++ b/tests/phpunit/includes/api/query/ApiQueryTestBase.php
@@ -56,12 +56,12 @@ STR;
* @return array
*/
private function validateRequestExpectedPair( $v ) {
- $this->assertType( 'array', $v, self::PARAM_ASSERT );
+ $this->assertInternalType( 'array', $v, self::PARAM_ASSERT );
$this->assertEquals( 2, count( $v ), self::PARAM_ASSERT );
$this->assertArrayHasKey( 0, $v, self::PARAM_ASSERT );
$this->assertArrayHasKey( 1, $v, self::PARAM_ASSERT );
- $this->assertType( 'array', $v[0], self::PARAM_ASSERT );
- $this->assertType( 'array', $v[1], self::PARAM_ASSERT );
+ $this->assertInternalType( 'array', $v[0], self::PARAM_ASSERT );
+ $this->assertInternalType( 'array', $v[1], self::PARAM_ASSERT );
return $v;
}
@@ -87,6 +87,7 @@ STR;
/**
* Checks that the request's result matches the expected results.
+ * Assumes no rawcontinue and a complete batch.
* @param array $values Array is a two element array( request, expected_results )
* @param array $session
* @param bool $appendModule
@@ -99,8 +100,9 @@ STR;
if ( !array_key_exists( 'action', $req ) ) {
$req['action'] = 'query';
}
- if ( !array_key_exists( 'continue', $req ) ) {
- $req['rawcontinue'] = '1';
+ // Silence warning
+ if ( !isset( $params['continue'] ) ) {
+ $params['continue'] = '';
}
foreach ( $req as &$val ) {
if ( is_array( $val ) ) {
@@ -108,7 +110,7 @@ STR;
}
}
$result = $this->doApiRequest( $req, $session, $appendModule, $user );
- $this->assertResult( array( 'query' => $exp ), $result[0], $req );
+ $this->assertResult( array( 'batchcomplete' => true, 'query' => $exp ), $result[0], $req );
}
protected function assertResult( $exp, $result, $message = '' ) {