本文整理汇总了PHP中TestSuite::flagColorization方法的典型用法代码示例。如果您正苦于以下问题:PHP TestSuite::flagColorization方法的具体用法?PHP TestSuite::flagColorization怎么用?PHP TestSuite::flagColorization使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestSuite
的用法示例。
在下文中一共展示了TestSuite::flagColorization方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ini_set
ini_set('display_errors', '1');
/* Grab options */
$arr_args = getopt('', array('class:', 'test:', 'nocolors'));
/* Grab the test the user is trying to run */
$arr_valid_classes = array('redis', 'redisarray', 'rediscluster');
$str_class = isset($arr_args['class']) ? strtolower($arr_args['class']) : 'redis';
$boo_colorize = !isset($arr_args['nocolors']);
/* Get our test filter if provided one */
$str_filter = isset($arr_args['test']) ? $arr_args['test'] : NULL;
/* 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);