- allow passing request options to the ctor
[m6w6/ext-http] / tests / skip.inc
1 <?php
2 defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
3 function skipif($if, $skip) { if ($if) { fprintf(STDOUT, "skip $skip"); exit(); }}
4 function checkcgi() { skipif(!strncasecmp('CLI', PHP_SAPI, 3), 'need CGI SAPI'); }
5 function checkext($ext) { skipif(!extension_loaded($ext), "need ext/$ext"); }
6 function checkver($ver) { skipif(round($ver,1) > round((double) PHP_VERSION,1), "need PHP v$ver"); }
7 function checkurl($url) { skipif(!@fsockopen($url, 80), "$url not responsive"); }
8 function checkcls($cls) { skipif(!class_exists($cls), "need class $cls"); }
9 checkext('http');
10 ?>