Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7478420
AutoBlockTargetTest.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
AutoBlockTargetTest.php
View Options
<?php
use
MediaWiki\Block\AutoBlockTarget
;
use
MediaWiki\Block\Block
;
/**
* @covers \MediaWiki\Block\AutoBlockTarget
*/
class
AutoBlockTargetTest
extends
MediaWikiUnitTestCase
{
public
function
testToString
()
{
$target
=
new
AutoBlockTarget
(
1234
,
false
);
$this
->
assertSame
(
'#1234'
,
$target
->
toString
()
);
}
public
function
testGetType
()
{
$target
=
new
AutoBlockTarget
(
1234
,
false
);
$this
->
assertSame
(
Block
::
TYPE_AUTO
,
$target
->
getType
()
);
}
public
function
testGetLogPage
()
{
$target
=
new
AutoBlockTarget
(
1234
,
false
);
$page
=
$target
->
getLogPage
();
$this
->
assertSame
(
NS_USER
,
$page
->
getNamespace
()
);
$this
->
assertSame
(
'#1234'
,
$page
->
getDBkey
()
);
}
public
function
testGetSpecificity
()
{
$target
=
new
AutoBlockTarget
(
1234
,
false
);
$this
->
assertSame
(
2
,
$target
->
getSpecificity
()
);
}
public
function
testValidateForCreation
()
{
$target
=
new
AutoBlockTarget
(
1234
,
false
);
$this
->
assertStatusNotOK
(
$target
->
validateForCreation
()
);
}
public
function
testGetId
()
{
$target
=
new
AutoBlockTarget
(
1234
,
false
);
$this
->
assertSame
(
1234
,
$target
->
getId
()
);
}
public
function
testGetLegacyTuple
()
{
$target
=
new
AutoBlockTarget
(
1234
,
false
);
[
$id
,
$type
]
=
$target
->
getLegacyTuple
();
$this
->
assertSame
(
'1234'
,
$id
);
$this
->
assertSame
(
Block
::
TYPE_AUTO
,
$type
);
}
public
function
testGetWikiId
()
{
$target
=
new
AutoBlockTarget
(
1234
,
'enwiki'
);
$this
->
assertSame
(
'enwiki'
,
$target
->
getWikiId
()
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 11:15 (4 d, 17 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2e/b3/828ee26b3760f7b5fe8ed5f4dbeb
Default Alt Text
AutoBlockTargetTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment