public function testAll($format, $file, $expected)
{
$detect = LanguageDetector\Detect::initByPath(__DIR__ . "/../example/datafile.{$format}");
$lang = $detect->detect(file_get_contents($file));
if (is_array($lang)) {
$this->assertEquals($expected, $lang[0]['lang']);
return;
}
$this->assertEquals($expected, $lang);
}