Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4104843
NamespaceRestrictionTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
950 B
Referenced Files
None
Subscribers
None
NamespaceRestrictionTest.php
View Options
<?php
namespace
MediaWiki\Tests\Block\Restriction
;
use
MediaWiki\Block\Restriction\NamespaceRestriction
;
/**
* @group Database
* @group Blocking
* @covers \MediaWiki\Block\Restriction\AbstractRestriction
* @covers \MediaWiki\Block\Restriction\NamespaceRestriction
*/
class
NamespaceRestrictionTest
extends
RestrictionTestCase
{
public
function
testMatches
()
{
$class
=
$this
->
getClass
();
$page
=
$this
->
getExistingTestPage
(
'Saturn'
);
$restriction
=
new
$class
(
1
,
NS_MAIN
);
$this
->
assertTrue
(
$restriction
->
matches
(
$page
->
getTitle
()
)
);
$page
=
$this
->
getExistingTestPage
(
'Talk:Saturn'
);
$this
->
assertFalse
(
$restriction
->
matches
(
$page
->
getTitle
()
)
);
}
public
function
testGetType
()
{
$class
=
$this
->
getClass
();
$restriction
=
new
$class
(
1
,
2
);
$this
->
assertEquals
(
'ns'
,
$restriction
->
getType
()
);
}
/**
* @inheritDoc
*/
protected
function
getClass
()
{
return
NamespaceRestriction
::
class
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 18:40 (3 w, 13 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
02/b4/a04bc157bae8c4d4c6a823816018
Default Alt Text
NamespaceRestrictionTest.php (950 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment