Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4119939
HistoryTest.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
HistoryTest.php
View Options
<?php
use
MediaWiki\User\User
;
/**
* @group CentralNotice
* @group medium
* @group Database
*/
class
HistoryTest
extends
MediaWikiIntegrationTestCase
{
private
User
$userUser
;
private
CentralNoticeTestFixtures
$cnFixtures
;
protected
function
setUp
():
void
{
parent
::
setUp
();
$this
->
userUser
=
$this
->
getTestUser
()->
getUser
();
$this
->
cnFixtures
=
new
CentralNoticeTestFixtures
(
$this
->
getTestSysop
()->
getUser
()
);
}
protected
function
tearDown
():
void
{
$this
->
cnFixtures
->
tearDownTestCases
();
parent
::
tearDown
();
}
/**
* @covers Campaign::getHistoricalCampaigns
*/
public
function
testStaleHistoricalCampaigns
()
{
// Bug was that expired campaigns would still be included in the
// history, as long as they were enabled.
$this
->
cnFixtures
->
setupTestCaseWithDefaults
(
[
'setup'
=>
[
'campaigns'
=>
[
[
'banners'
=>
[
[]
],
],
],
]
]
);
$made_by_ts
=
wfTimestamp
(
TS_MW
);
$this
->
assertCount
(
1
,
Campaign
::
getHistoricalCampaigns
(
$made_by_ts
)
);
$initialSettings
=
Campaign
::
getCampaignSettings
(
$this
->
cnFixtures
->
spec
[
'campaigns'
][
0
][
'name'
]
);
sleep
(
1
);
// FIXME: Campaign::updateSettings
$newSettings
=
[
'end'
=>
$made_by_ts
,
]
+
$initialSettings
;
Campaign
::
updateNoticeDate
(
$this
->
cnFixtures
->
spec
[
'campaigns'
][
0
][
'name'
],
$newSettings
[
'start'
],
$newSettings
[
'end'
]
);
Campaign
::
processAfterCampaignChange
(
'modified'
,
$this
->
cnFixtures
->
spec
[
'campaigns'
][
0
][
'id'
],
$this
->
cnFixtures
->
spec
[
'campaigns'
][
0
][
'name'
],
$this
->
userUser
,
$initialSettings
,
$newSettings
);
$modified_ts
=
wfTimestamp
(
TS_MW
);
$this
->
assertCount
(
0
,
Campaign
::
getHistoricalCampaigns
(
$modified_ts
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 03:44 (1 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
59/27/0b534889ffa675be6a557ec9a013
Default Alt Text
HistoryTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment