X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FApiBaseTest.php;h=ea0cb8a8807644746da35384b3fdbe644ea2339f;hb=825d66bfa44c5dae2b78e2fe4f3b16f16aff4a12;hp=64b2cd651ccdd4f54215d18c6c511886f635e8e5;hpb=4b9ff27122ef8aaa23eaf7ba84ba66ad43b22d81;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/ApiBaseTest.php b/tests/phpunit/includes/api/ApiBaseTest.php index 64b2cd651c..ea0cb8a880 100644 --- a/tests/phpunit/includes/api/ApiBaseTest.php +++ b/tests/phpunit/includes/api/ApiBaseTest.php @@ -1,5 +1,6 @@ false ], ], - 'Limit with parseLimits false' => [ + 'Limit with parseLimits false (numeric)' => [ '100', [ ApiBase::PARAM_TYPE => 'limit' ], - '100', + 100, + [], + [ 'parseLimits' => false ], + ], + 'Limit with parseLimits false (max)' => [ + 'max', + [ ApiBase::PARAM_TYPE => 'limit' ], + 'max', + [], + [ 'parseLimits' => false ], + ], + 'Limit with parseLimits false (invalid)' => [ + 'kitten', + [ ApiBase::PARAM_TYPE => 'limit' ], + 0, [], [ 'parseLimits' => false ], ], @@ -900,7 +915,6 @@ class ApiBaseTest extends ApiTestCase { [ ApiBase::PARAM_TYPE => 'limit', ApiBase::PARAM_MAX2 => 10, - ApiBase::PARAM_ISMULTI => true, ], new MWException( 'Internal error in ApiBase::getParameterFromSettings: ' . @@ -912,7 +926,6 @@ class ApiBaseTest extends ApiTestCase { [ ApiBase::PARAM_TYPE => 'limit', ApiBase::PARAM_MAX => 10, - ApiBase::PARAM_ISMULTI => true, ], new MWException( 'Internal error in ApiBase::getParameterFromSettings: ' . @@ -1325,7 +1338,7 @@ class ApiBaseTest extends ApiTestCase { // Has a blocked $user, so special block handling $user = $this->getMutableTestUser()->getUser(); - $block = new \Block( [ + $block = new DatabaseBlock( [ 'address' => $user->getName(), 'user' => $user->getID(), 'by' => $this->getTestSysop()->getUser()->getId(), @@ -1383,7 +1396,7 @@ class ApiBaseTest extends ApiTestCase { // Has a blocked $user, so special block handling $user = $this->getMutableTestUser()->getUser(); - $block = new \Block( [ + $block = new DatabaseBlock( [ 'address' => $user->getName(), 'user' => $user->getID(), 'by' => $this->getTestSysop()->getUser()->getId(), @@ -1442,7 +1455,7 @@ class ApiBaseTest extends ApiTestCase { } $status = StatusValue::newGood(); - $status->setOk( false ); + $status->setOK( false ); try { $mock->dieStatus( $status ); $this->fail( 'Expected exception not thrown' );