X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fskip.inc;h=5665d5dddd141f65563b86bfea15a3911cdae10e;hb=bcb27bf6556208cded77e37805852fc2585e8a9f;hp=98b15e3242235a8b8092aec39062df02fa9c09ba;hpb=4a1c5914eccd82e0936f35f0804a9e35ed632f83;p=m6w6%2Fext-http diff --git a/tests/skip.inc b/tests/skip.inc index 98b15e3..5665d5d 100644 --- a/tests/skip.inc +++ b/tests/skip.inc @@ -3,7 +3,10 @@ defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w')); function skipif($if, $skip) { if ($if) { fprintf(STDOUT, "skip $skip"); exit(); }} function checkcgi() { skipif(!strncasecmp('CLI', PHP_SAPI, 3), 'need CGI SAPI'); } function checkext($ext) { skipif(!extension_loaded($ext), "need ext/$ext"); } -function checkver($ver) { skipif($ver > (int) PHP_VERSION, "need PHP v$ver"); } +function checkmin($ver) { skipif(round($ver,1) > round((double) PHP_VERSION,1), sprintf("need PHP >= v%0.1f",$ver)); } +function checkmax($ver) { skipif(round($ver,1) < round((double) PHP_VERSION,1), sprintf("need PHP <= v%0.1f",$ver)); } function checkurl($url) { skipif(!@fsockopen($url, 80), "$url not responsive"); } +function checkcls($cls) { skipif(!class_exists($cls), "need class $cls"); } +function checkver($ver) { checkmin($ver); } checkext('http'); ?>