Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3295583
HeraldRuleTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
900 B
Referenced Files
None
Subscribers
None
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'
)
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Mar 27, 02:39 (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1130791
Default Alt Text
HeraldRuleTestCase.php (900 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment