本文整理匯總了PHP中FileUtils::randomFromFolder方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileUtils::randomFromFolder方法的具體用法?PHP FileUtils::randomFromFolder怎麽用?PHP FileUtils::randomFromFolder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileUtils
的用法示例。
在下文中一共展示了FileUtils::randomFromFolder方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testRandomFromFolderWithFoldersNoMtime
function testRandomFromFolderWithFoldersNoMtime()
{
$count = 0;
$another_count = 0;
$css_count = 0;
$ext_count = 0;
$test_count = 0;
for ($i = 0; $i < 30; $i++) {
$result = FileUtils::randomFromFolder("/" . FRAMEWORK_CORE_PATH . "tests/io/test_dir/content_dir/", false, true);
$this->assertNotNull($result);
if ($result == "/" . FRAMEWORK_CORE_PATH . "tests/io/test_dir/content_dir/another_dir/") {
$another_count += 1;
}
if ($result == "/" . FRAMEWORK_CORE_PATH . "tests/io/test_dir/content_dir/css_test.css") {
$css_count += 1;
}
if ($result == "/" . FRAMEWORK_CORE_PATH . "tests/io/test_dir/content_dir/ext_test.plug.txt") {
$ext_count += 1;
}
if ($result == "/" . FRAMEWORK_CORE_PATH . "tests/io/test_dir/content_dir/test_file.txt") {
$test_count += 1;
}
$sum = $another_count + $css_count + $ext_count + $test_count;
$this->assertTrue($count == $sum - 1);
$count += 1;
}
}