diff options
| author | Marcus Boerger <helly@php.net> | 2003-05-06 01:23:35 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2003-05-06 01:23:35 +0000 |
| commit | 6360bda763320434571b97f4707b773fbd35373e (patch) | |
| tree | 1370942a774e3a7d91df94e943b0da08d63b2ab6 | |
| parent | 46b1372de7c1ba4eff558fdbfff70286abeb5119 (diff) | |
| download | php-git-6360bda763320434571b97f4707b773fbd35373e.tar.gz | |
Find a better solution for the tests
| -rw-r--r-- | ext/dba/tests/skipif.inc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/ext/dba/tests/skipif.inc b/ext/dba/tests/skipif.inc index 2fc81ca773..5612e682a3 100644 --- a/ext/dba/tests/skipif.inc +++ b/ext/dba/tests/skipif.inc @@ -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())) { |
