Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F76531970
HeraldRuleTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 8, 13:02
Size
900 B
Mime Type
text/x-php
Expires
Sat, Aug 10, 13:02 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19729304
Attached To
rPH Phabricator
HeraldRuleTestCase.php
View Options
<?php
final
class
HeraldRuleTestCase
extends
PhabricatorTestCase
{
public
function
testHeraldRuleExecutionOrder
()
{
$rules
=
array
(
1
=>
HeraldRuleTypeConfig
::
RULE_TYPE_GLOBAL
,
2
=>
HeraldRuleTypeConfig
::
RULE_TYPE_GLOBAL
,
3
=>
HeraldRuleTypeConfig
::
RULE_TYPE_OBJECT
,
4
=>
HeraldRuleTypeConfig
::
RULE_TYPE_PERSONAL
,
5
=>
HeraldRuleTypeConfig
::
RULE_TYPE_GLOBAL
,
6
=>
HeraldRuleTypeConfig
::
RULE_TYPE_PERSONAL
,
);
foreach
(
$rules
as
$id
=>
$type
)
{
$rules
[
$id
]
=
id
(
new
HeraldRule
())
->
setID
(
$id
)
->
setRuleType
(
$type
);
}
shuffle
(
$rules
);
$rules
=
msort
(
$rules
,
'getRuleExecutionOrderSortKey'
);
$this
->
assertEqual
(
array
(
// Personal
4
,
6
,
// Object
3
,
// Global
1
,
2
,
5
,
),
array_values
(
mpull
(
$rules
,
'getID'
)));
}
}
Event Timeline
Log In to Comment