Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61307992
PhutilXHPASTSyntaxHighlighterTestCase.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
Sun, May 5, 20:38
Size
868 B
Mime Type
text/x-php
Expires
Tue, May 7, 20:38 (2 d)
Engine
blob
Format
Raw Data
Handle
17493602
Attached To
rPHU libphutil
PhutilXHPASTSyntaxHighlighterTestCase.php
View Options
<?php
/**
* @group testcase
*/
final
class
PhutilXHPASTSyntaxHighlighterTestCase
extends
PhutilTestCase
{
private
function
highlight
(
$source
)
{
$highlighter
=
new
PhutilXHPASTSyntaxHighlighter
();
$future
=
$highlighter
->
getHighlightFuture
(
$source
);
return
$future
->
resolve
();
}
private
function
read
(
$file
)
{
$path
=
dirname
(
__FILE__
).
'/xhpast/'
.
$file
;
return
Filesystem
::
readFile
(
$path
);
}
public
function
testBuiltinClassnames
()
{
$this
->
assertEqual
(
$this
->
read
(
'builtin-classname.expect'
),
$this
->
highlight
(
$this
->
read
(
'builtin-classname.source'
)),
'Builtin classnames should not be marked as linkable symbols.'
);
$this
->
assertEqual
(
$this
->
read
(
'trailing-comment.expect'
),
$this
->
highlight
(
$this
->
read
(
'trailing-comment.source'
)),
'Trailing comments should not be dropped.'
);
}
}
Event Timeline
Log In to Comment