Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95661213
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
Wed, Dec 18, 03:15
Size
602 B
Mime Type
text/x-php
Expires
Fri, Dec 20, 03:15 (2 d)
Engine
blob
Format
Raw Data
Handle
23038656
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