Changeset View
Changeset View
Standalone View
Standalone View
src/parser/__tests__/PhutilLanguageGuesserTestCase.php
<?php | <?php | ||||
final class PhutilLanguageGuesserTestCase extends PhutilTestCase { | final class PhutilLanguageGuesserTestCase extends PhutilTestCase { | ||||
public function testGuessing() { | public function testGuessing() { | ||||
$dir = dirname(__FILE__).'/languageguesser/'; | $dir = __DIR__.'/languageguesser/'; | ||||
foreach (Filesystem::listDirectory($dir, $hidden = false) as $test) { | foreach (Filesystem::listDirectory($dir, $hidden = false) as $test) { | ||||
$source = Filesystem::readFile($dir.$test); | $source = Filesystem::readFile($dir.$test); | ||||
if (strpos($test, '.') !== false) { | if (strpos($test, '.') !== false) { | ||||
$expect = head(explode('.', $test)); | $expect = head(explode('.', $test)); | ||||
} else { | } else { | ||||
$expect = null; | $expect = null; | ||||
} | } | ||||
Show All 9 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0