Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4099009
ApiFeedRecentChangesTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ApiFeedRecentChangesTest.php
View Options
<?php
namespace
MediaWiki\Tests\Api
;
use
MediaWiki\Api\ApiBase
;
use
MediaWiki\Api\ApiFeedRecentChanges
;
use
MediaWiki\Api\ApiMain
;
use
MediaWiki\Context\RequestContext
;
use
MediaWiki\Tests\User\TempUser\TempUserTestTrait
;
use
MediaWikiIntegrationTestCase
;
/**
* @group API
* @covers \MediaWiki\Api\ApiFeedRecentChanges
*/
class
ApiFeedRecentChangesTest
extends
MediaWikiIntegrationTestCase
{
use
TempUserTestTrait
;
private
function
commonTestGetAllowedParamsForHideAnons
(
$expectedMessageKey
)
{
$ctx
=
new
RequestContext
();
$apiMain
=
new
ApiMain
(
$ctx
);
$api
=
new
ApiFeedRecentChanges
(
$apiMain
,
'feedrecentchanges'
,
$this
->
getServiceContainer
()->
getSpecialPageFactory
(),
$this
->
getServiceContainer
()->
getTempUserConfig
()
);
$params
=
$api
->
getAllowedParams
();
$this
->
assertArrayHasKey
(
'hideanons'
,
$params
);
$this
->
assertSame
(
$expectedMessageKey
,
$params
[
'hideanons'
][
ApiBase
::
PARAM_HELP_MSG
]
);
}
public
function
testGetAllowedParamsWhenTemporaryAccountsAreEnabled
()
{
$this
->
enableAutoCreateTempUser
();
$this
->
commonTestGetAllowedParamsForHideAnons
(
'apihelp-feedrecentchanges-param-hideanons-temp'
);
}
public
function
testGetAllowedParamsWhenTemporaryAccountsAreNotEnabled
()
{
$this
->
disableAutoCreateTempUser
();
$this
->
commonTestGetAllowedParamsForHideAnons
(
'apihelp-feedrecentchanges-param-hideanons'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 15:38 (3 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c7/e0/cd89ac644cb091e88c09403a1d2b
Default Alt Text
ApiFeedRecentChangesTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment