Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2753039
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
Fri, Jul 3, 20:41 (22 h, 27 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4a/a2/aa76c0f9fe8e2ef11c550ef90533
Default Alt Text
HistoryTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment