summaryrefslogtreecommitdiffstats
path: root/tests-skipcheck.inc.php
blob: 0d494a9a5e5e9e9490e61b64a083a83c2d2c9743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
extension_loaded('timecop') or die('skip timecop module not available');
if (isset($required_version)) {
    if (version_compare(PHP_VERSION, $required_version, "<")) {
        die("skip PHP ${required_version}+ required for this test");
    }
}
if (isset($required_func)) {
    foreach ($required_func as $func_name) {
        if (!function_exists($func_name)) {
            die("skip $func_name() function is not available.");
        }
    }
}
if (isset($required_class)) {
    foreach ($required_class as $class_name) {
        if (!class_exists($class_name)) {
            die("skip $class_name class is not available.");
        }
    }
}
if (isset($required_method)) {
    foreach ($required_method as $v) {
        list($class_name, $method_name) = $v;
        if (!method_exists($class_name, $method_name)) {
            die("skip $class_name::$method_name() method is not available.");
        }
    }
}