dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix method/function names case mismatch in core files
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
api
/
ApiBaseTest.php
diff --git
a/tests/phpunit/includes/api/ApiBaseTest.php
b/tests/phpunit/includes/api/ApiBaseTest.php
index
0dc64df
..
3adf1b6
100644
(file)
--- a/
tests/phpunit/includes/api/ApiBaseTest.php
+++ b/
tests/phpunit/includes/api/ApiBaseTest.php
@@
-1,5
+1,7
@@
<?php
<?php
+use MediaWiki\Block\DatabaseBlock;
+use MediaWiki\MediaWikiServices;
use Wikimedia\TestingAccessWrapper;
/**
use Wikimedia\TestingAccessWrapper;
/**
@@
-643,7
+645,7
@@
class ApiBaseTest extends ApiTestCase {
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_TYPE => 'namespace',
],
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_TYPE => 'namespace',
],
- M
WNamespace::
getValidNamespaces(),
+ M
ediaWikiServices::getInstance()->getNamespaceInfo()->
getValidNamespaces(),
[],
],
// PARAM_ALL is ignored with namespace types.
[],
],
// PARAM_ALL is ignored with namespace types.
@@
-654,7
+656,7
@@
class ApiBaseTest extends ApiTestCase {
ApiBase::PARAM_TYPE => 'namespace',
ApiBase::PARAM_ALL => false,
],
ApiBase::PARAM_TYPE => 'namespace',
ApiBase::PARAM_ALL => false,
],
- M
WNamespace::
getValidNamespaces(),
+ M
ediaWikiServices::getInstance()->getNamespaceInfo()->
getValidNamespaces(),
[],
],
'Namespace with wildcard "x"' => [
[],
],
'Namespace with wildcard "x"' => [
@@
-1324,7
+1326,7
@@
class ApiBaseTest extends ApiTestCase {
// Has a blocked $user, so special block handling
$user = $this->getMutableTestUser()->getUser();
// Has a blocked $user, so special block handling
$user = $this->getMutableTestUser()->getUser();
- $block = new
\
Block( [
+ $block = new
Database
Block( [
'address' => $user->getName(),
'user' => $user->getID(),
'by' => $this->getTestSysop()->getUser()->getId(),
'address' => $user->getName(),
'user' => $user->getID(),
'by' => $this->getTestSysop()->getUser()->getId(),
@@
-1332,7
+1334,10
@@
class ApiBaseTest extends ApiTestCase {
'expiry' => time() + 100500,
] );
$block->insert();
'expiry' => time() + 100500,
] );
$block->insert();
- $blockinfo = [ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $block ) ];
+ $userInfoTrait = TestingAccessWrapper::newFromObject(
+ $this->getMockForTrait( ApiBlockInfoTrait::class )
+ );
+ $blockinfo = [ 'blockinfo' => $userInfoTrait->getBlockDetails( $block ) ];
$expect = Status::newGood();
$expect->fatal( ApiMessage::create( 'apierror-blocked', 'blocked', $blockinfo ) );
$expect = Status::newGood();
$expect->fatal( ApiMessage::create( 'apierror-blocked', 'blocked', $blockinfo ) );
@@
-1379,7
+1384,7
@@
class ApiBaseTest extends ApiTestCase {
// Has a blocked $user, so special block handling
$user = $this->getMutableTestUser()->getUser();
// Has a blocked $user, so special block handling
$user = $this->getMutableTestUser()->getUser();
- $block = new
\
Block( [
+ $block = new
Database
Block( [
'address' => $user->getName(),
'user' => $user->getID(),
'by' => $this->getTestSysop()->getUser()->getId(),
'address' => $user->getName(),
'user' => $user->getID(),
'by' => $this->getTestSysop()->getUser()->getId(),
@@
-1387,7
+1392,10
@@
class ApiBaseTest extends ApiTestCase {
'expiry' => time() + 100500,
] );
$block->insert();
'expiry' => time() + 100500,
] );
$block->insert();
- $blockinfo = [ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $block ) ];
+ $userInfoTrait = TestingAccessWrapper::newFromObject(
+ $this->getObjectForTrait( ApiBlockInfoTrait::class )
+ );
+ $blockinfo = [ 'blockinfo' => $userInfoTrait->getBlockDetails( $block ) ];
$expect = Status::newGood();
$expect->fatal( ApiMessage::create( 'apierror-blocked', 'blocked', $blockinfo ) );
$expect = Status::newGood();
$expect->fatal( ApiMessage::create( 'apierror-blocked', 'blocked', $blockinfo ) );
@@
-1435,7
+1443,7
@@
class ApiBaseTest extends ApiTestCase {
}
$status = StatusValue::newGood();
}
$status = StatusValue::newGood();
- $status->setO
k
( false );
+ $status->setO
K
( false );
try {
$mock->dieStatus( $status );
$this->fail( 'Expected exception not thrown' );
try {
$mock->dieStatus( $status );
$this->fail( 'Expected exception not thrown' );