コード例 #1
0
ファイル: TestRedis.php プロジェクト: qmario/phpredis-2.5.5
/* Validate the class is known */
if (!in_array($str_class, $arr_valid_classes)) {
    echo "Error:  Valid test classes are Redis, RedisArray, and RedisCluster!\n";
    exit(1);
}
/* Toggle colorization in our TestSuite class */
TestSuite::flagColorization($boo_colorize);
/* Let the user know this can take a bit of time */
echo "Note: these tests might take up to a minute. Don't worry :-)\n";
/* Depending on the classes being tested, run our tests on it */
echo "Testing class ";
if ($str_class == 'redis') {
    echo TestSuite::make_bold("Redis") . "\n";
    exit(TestSuite::run("Redis_Test", $str_filter));
} else {
    if ($str_class == 'redisarray') {
        echo TestSuite::make_bold("RedisArray") . "\n";
        global $useIndex;
        foreach (array(true, false) as $useIndex) {
            echo "\n" . ($useIndex ? "WITH" : "WITHOUT") . " per-node index:\n";
            run_tests('Redis_Array_Test', $str_filter);
            run_tests('Redis_Rehashing_Test', $str_filter);
            run_tests('Redis_Auto_Rehashing_Test', $str_filter);
            run_tests('Redis_Multi_Exec_Test', $str_filter);
            run_tests('Redis_Distributor_Test', $str_filter);
        }
    } else {
        echo TestSuite::make_bold("RedisCluster") . "\n";
        exit(TestSuite::run("Redis_Cluster_Test", $str_filter));
    }
}