Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91891216
PhutilLanguageGuesserTestCase.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, Nov 15, 12:34
Size
602 B
Mime Type
text/x-php
Expires
Sun, Nov 17, 12:34 (2 d)
Engine
blob
Format
Raw Data
Handle
22342656
Attached To
rPHU libphutil
PhutilLanguageGuesserTestCase.php
View Options
<?php
/**
* @group testcase
*/
final
class
PhutilLanguageGuesserTestCase
extends
PhutilTestCase
{
public
function
testGuessing
()
{
$dir
=
dirname
(
__FILE__
).
'/languageguesser/'
;
foreach
(
Filesystem
::
listDirectory
(
$dir
,
$hidden
=
false
)
as
$test
)
{
$source
=
Filesystem
::
readFile
(
$dir
.
$test
);
if
(
strpos
(
$test
,
'.'
)
!==
false
)
{
$expect
=
head
(
explode
(
'.'
,
$test
));
}
else
{
$expect
=
null
;
}
$this
->
assertEqual
(
$expect
,
PhutilLanguageGuesser
::
guessLanguage
(
$source
),
"Guessed language for '{$test}'."
);
}
}
}
Event Timeline
Log In to Comment