Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4149534
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 \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
Aug 19 2026, 19:13 (6 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9d/c6/a2ca093a250d091f143409ce65ec
Default Alt Text
ChangesListFilterGroupTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment