cvs: php4 /ext/dba/tests skipif.inc

From: Date: Tue, 06 May 2003 01:23:35 +0000
Subject: cvs: php4 /ext/dba/tests skipif.inc
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20723@lists.php.net to get a copy of this message
helly Mon May 5 21:23:35 2003 EDT Modified files: /php4/ext/dba/tests skipif.inc Log: Find a better solution for the tests Index: php4/ext/dba/tests/skipif.inc diff -u php4/ext/dba/tests/skipif.inc:1.6 php4/ext/dba/tests/skipif.inc:1.7 --- php4/ext/dba/tests/skipif.inc:1.6 Tue Mar 4 15:31:42 2003 +++ php4/ext/dba/tests/skipif.inc Mon May 5 21:23:35 2003 @@ -4,16 +4,14 @@ if (!sizeof(dba_handlers())) die('skip no handlers installed'); if (!isset($handler)) { $handlers = dba_handlers(); - $handler = false; - $acceptable = array('flatfile','db4','db3','db2','gdbm','ndbm','dbm','inifile'); - foreach($acceptable as $hnd) { - if (in_array($hnd, $handlers)) { - $handler = $hnd; - break; + if (in_array('flatfile', $handlers)) { + $handler = 'flatfile'; + } else { + $handler = array_diff($handler, array('cdb', 'cdb_make')); /* these can only read OR write */ + if (count($handler)==0) { + die('skip no handler available that can be used for the test'); } - } - if ($handler === false) { - die('skip No acceptable handler found'); + $handler = array_shift($handler); } } else { if (!in_array($handler, dba_handlers())) {

« previous php.cvs (#20723) next »