Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F545925
PhutilPygmentizeParserTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1003 B
Referenced Files
None
Subscribers
None
PhutilPygmentizeParserTestCase.php
View Options
<?php
final
class
PhutilPygmentizeParserTestCase
extends
PhutilTestCase
{
public
function
testPygmentizeParser
()
{
$this
->
tryParser
(
''
,
''
,
array
(),
pht
(
'Empty'
));
$this
->
tryParser
(
'<span class="mi">1</span>'
,
'<span style="color: #ff0000">1</span>'
,
array
(
'mi'
=>
'color: #ff0000'
,
),
pht
(
'Simple'
));
$this
->
tryParser
(
'<span class="mi">1</span>'
,
'<span class="mi">1</span>'
,
array
(),
pht
(
'Missing Class'
));
$this
->
tryParser
(
'<span data-symbol-name="X" class="nc">X</span>'
,
'<span data-symbol-name="X" style="color: #ff0000">X</span>'
,
array
(
'nc'
=>
'color: #ff0000'
,
),
pht
(
'Extra Attribute'
));
}
private
function
tryParser
(
$input
,
$expect
,
array
$map
,
$label
)
{
$actual
=
id
(
new
PhutilPygmentizeParser
())
->
setMap
(
$map
)
->
parse
(
$input
);
$this
->
assertEqual
(
$expect
,
$actual
,
pht
(
'Pygmentize Parser: %s'
,
$label
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:03 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
122542
Default Alt Text
PhutilPygmentizeParserTestCase.php (1003 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment