Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7493950
PurgeOldTextTest.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
PurgeOldTextTest.php
View Options
<?php
namespace
MediaWiki\Tests\Maintenance
;
use
MediaWiki\Maintenance\Maintenance
;
use
PHPUnit\Framework\MockObject\MockObject
;
use
PurgeOldText
;
use
Wikimedia\TestingAccessWrapper
;
/**
* @covers \PurgeOldText
* @author Dreamy Jazz
*/
class
PurgeOldTextTest
extends
MaintenanceBaseTestCase
{
/** @var Maintenance|MockObject */
protected
$maintenance
;
public
function
getMaintenanceClass
()
{
return
PurgeOldText
::
class
;
}
protected
function
createMaintenance
()
{
// Mock ::purgeRedundantText as this should be separately tested
$obj
=
$this
->
getMockBuilder
(
$this
->
getMaintenanceClass
()
)
->
onlyMethods
(
[
'purgeRedundantText'
]
)
->
getMock
();
return
TestingAccessWrapper
::
newFromObject
(
$obj
);
}
/** @dataProvider providePurgeOptionValues */
public
function
testExecute
(
$purgeOptionProvided
)
{
$this
->
maintenance
->
expects
(
$this
->
once
()
)
->
method
(
'purgeRedundantText'
)
->
with
(
$purgeOptionProvided
);
if
(
$purgeOptionProvided
)
{
$this
->
maintenance
->
setOption
(
'purge'
,
1
);
}
$this
->
maintenance
->
execute
();
}
public
static
function
providePurgeOptionValues
()
{
return
[
'--purge not provided'
=>
[
false
],
'--purge provided'
=>
[
true
],
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 21:02 (6 d, 9 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a9/ef/fc01b3c7cb641f3fae2b21b0a541
Default Alt Text
PurgeOldTextTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment