Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102531497
DifferentialCustomFieldDependsOnParserTestCase.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
Fri, Feb 21, 17:14
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 23, 17:14 (2 d)
Engine
blob
Format
Raw Data
Handle
24354622
Attached To
rPH Phabricator
DifferentialCustomFieldDependsOnParserTestCase.php
View Options
<?php
final
class
DifferentialCustomFieldDependsOnParserTestCase
extends
PhabricatorTestCase
{
public
function
testParser
()
{
$map
=
array
(
'quack quack quack'
=>
array
(),
'D123'
=>
array
(),
'depends on D123'
=>
array
(
array
(
'match'
=>
'depends on D123'
,
'prefix'
=>
'depends on'
,
'infix'
=>
''
,
'monograms'
=>
array
(
'D123'
),
'suffix'
=>
''
,
'offset'
=>
0
,
),
),
'depends on D123.'
=>
array
(
array
(
'match'
=>
'depends on D123'
,
'prefix'
=>
'depends on'
,
'infix'
=>
''
,
'monograms'
=>
array
(
'D123'
),
'suffix'
=>
''
,
'offset'
=>
0
,
),
),
'depends on D123, d124'
=>
array
(
array
(
'match'
=>
'depends on D123, d124'
,
'prefix'
=>
'depends on'
,
'infix'
=>
''
,
'monograms'
=>
array
(
'D123'
,
'd124'
),
'suffix'
=>
''
,
'offset'
=>
0
,
),
),
'depends on rev D123'
=>
array
(
array
(
'match'
=>
'depends on rev D123'
,
'prefix'
=>
'depends on'
,
'infix'
=>
'rev'
,
'monograms'
=>
array
(
'D123'
),
'suffix'
=>
''
,
'offset'
=>
0
,
),
),
'depends on duck'
=>
array
(
),
'depends on D123abc'
=>
array
(
),
);
foreach
(
$map
as
$input
=>
$expect
)
{
$parser
=
new
DifferentialCustomFieldDependsOnParser
();
$output
=
$parser
->
parseCorpus
(
$input
);
$this
->
assertEqual
(
$expect
,
$output
,
$input
);
}
}
}
Event Timeline
Log In to Comment