Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7421448
ChangesListFilterGroupTest.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
ChangesListFilterGroupTest.php
View Options
<?php
/**
* @covers \MediaWiki\RecentChanges\ChangesListFilterGroup
*/
class
ChangesListFilterGroupTest
extends
\MediaWikiUnitTestCase
{
public
function
testReservedCharacter
()
{
$this
->
expectException
(
InvalidArgumentException
::
class
);
$this
->
expectExceptionMessage
(
"Group names may not contain '_'. Use the naming convention: 'camelCase'"
);
new
MockChangesListFilterGroup
(
[
'type'
=>
'some_type'
,
'name'
=>
'group_name'
,
'priority'
=>
1
,
'filters'
=>
[],
]
);
}
public
function
testAutoPriorities
()
{
$group
=
new
MockChangesListFilterGroup
(
[
'type'
=>
'some_type'
,
'name'
=>
'groupName'
,
'isFullCoverage'
=>
true
,
'priority'
=>
1
,
'filters'
=>
[
[
'name'
=>
'hidefoo'
],
[
'name'
=>
'hidebar'
],
[
'name'
=>
'hidebaz'
],
],
]
);
$filters
=
$group
->
getFilters
();
$this
->
assertEquals
(
[
-
2
,
-
3
,
-
4
,
],
array_map
(
static
function
(
$f
)
{
return
$f
->
getPriority
();
},
array_values
(
$filters
)
)
);
}
// Get without warnings
public
function
testGetFilter
()
{
$group
=
new
MockChangesListFilterGroup
(
[
'type'
=>
'some_type'
,
'name'
=>
'groupName'
,
'isFullCoverage'
=>
true
,
'priority'
=>
1
,
'filters'
=>
[
[
'name'
=>
'foo'
],
],
]
);
$this
->
assertEquals
(
'foo'
,
$group
->
getFilter
(
'foo'
)->
getName
()
);
$this
->
assertNull
(
$group
->
getFilter
(
'bar'
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 05:28 (1 d, 2 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
75/6d/f80f0a4ae70eabac50cce59e500b
Default Alt Text
ChangesListFilterGroupTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment