Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4115746
ApiCentralNoticeChoiceDataTest.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
ApiCentralNoticeChoiceDataTest.php
View Options
<?php
use
MediaWiki\Tests\Api\ApiTestCase
;
/**
* @group CentralNotice
* @group medium
* @group Database
* @covers ApiCentralNoticeChoiceData
*/
class
ApiCentralNoticeChoiceDataTest
extends
ApiTestCase
{
/** @var CentralNoticeTestFixtures */
private
$cnFixtures
;
protected
function
setUp
():
void
{
parent
::
setUp
();
$this
->
cnFixtures
=
new
CentralNoticeTestFixtures
(
$this
->
getTestSysop
()->
getUser
()
);
}
protected
function
tearDown
():
void
{
$this
->
cnFixtures
->
tearDownTestCases
();
parent
::
tearDown
();
}
/**
* @dataProvider CentralNoticeTestFixtures::allocationsTestCasesProvision
*/
public
function
testChoiceDataResponse
(
$name
,
$testCase
)
{
$this
->
cnFixtures
->
setupTestCaseFromFixtureData
(
$testCase
);
foreach
(
$testCase
[
'contexts_and_outputs'
]
as
$cAndOName
=>
$contextAndOutput
)
{
$ret
=
$this
->
doApiRequest
(
[
'action'
=>
'centralnoticechoicedata'
,
'project'
=>
$contextAndOutput
[
'context'
][
'project'
],
'language'
=>
$contextAndOutput
[
'context'
][
'language'
]
]
);
$this
->
cnFixtures
->
assertChoicesEqual
(
$this
,
$contextAndOutput
[
'choices'
],
$ret
[
0
][
'choices'
],
$cAndOName
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 01:01 (2 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
04/3a/e95cf2dfb8403f72e5a1bea38441
Default Alt Text
ApiCentralNoticeChoiceDataTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment