Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6141636
SpecialShortPagesTest.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
SpecialShortPagesTest.php
View Options
<?php
use
MediaWiki\MainConfigNames
;
use
MediaWiki\Specials\SpecialShortPages
;
/**
* @covers \MediaWiki\Specials\SpecialShortPages
* @license GPL-2.0-or-later
*/
class
SpecialShortPagesTest
extends
MediaWikiIntegrationTestCase
{
/**
* @dataProvider provideGetQueryInfoRespectsContentNs
*/
public
function
testGetQueryInfoRespectsContentNS
(
$contentNS
,
$blacklistNS
,
$expectedNS
)
{
$this
->
overrideConfigValues
(
[
MainConfigNames
::
ShortPagesNamespaceExclusions
=>
$blacklistNS
,
MainConfigNames
::
ContentNamespaces
=>
$contentNS
]
);
$this
->
setTemporaryHook
(
'ShortPagesQuery'
,
static
function
()
{
// empty hook handler
}
);
$services
=
$this
->
getServiceContainer
();
$page
=
new
SpecialShortPages
(
$services
->
getNamespaceInfo
(),
$services
->
getConnectionProvider
(),
$services
->
getLinkBatchFactory
()
);
$queryInfo
=
$page
->
getQueryInfo
();
$this
->
assertArrayHasKey
(
'conds'
,
$queryInfo
);
$this
->
assertArrayHasKey
(
'page_namespace'
,
$queryInfo
[
'conds'
]
);
$this
->
assertEquals
(
$expectedNS
,
$queryInfo
[
'conds'
][
'page_namespace'
]
);
}
public
static
function
provideGetQueryInfoRespectsContentNs
()
{
return
[
[
[
NS_MAIN
,
NS_FILE
],
[],
[
NS_MAIN
,
NS_FILE
]
],
[
[
NS_MAIN
,
NS_TALK
],
[
NS_FILE
],
[
NS_MAIN
,
NS_TALK
]
],
[
[
NS_MAIN
,
NS_FILE
],
[
NS_FILE
],
[
NS_MAIN
]
],
// NS_MAIN namespace is always forced
[
[],
[
NS_FILE
],
[
NS_MAIN
]
]
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 7 2026, 18:55 (6 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1a/58/8e1ffc6ff8d3c0897ae04b726188
Default Alt Text
SpecialShortPagesTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment