From: Marcus Boerger Date: Tue, 6 May 2003 01:26:21 +0000 (+0000) Subject: MFH new test layout X-Git-Tag: php-4.3.2RC3~81 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97807d68e94470c2cfbb96986a9c355b6cd91976;p=php MFH new test layout --- diff --git a/ext/dba/tests/dba_cdb.phpt b/ext/dba/tests/dba_cdb.phpt index 9a881706ee..af64dae5a6 100644 --- a/ext/dba/tests/dba_cdb.phpt +++ b/ext/dba/tests/dba_cdb.phpt @@ -2,14 +2,14 @@ DBA CDB handler test --SKIPIF-- --FILE-- --EXPECT-- diff --git a/ext/dba/tests/dba_cdb_make.phpt b/ext/dba/tests/dba_cdb_make.phpt index 40a417860c..77f764dbe0 100644 --- a/ext/dba/tests/dba_cdb_make.phpt +++ b/ext/dba/tests/dba_cdb_make.phpt @@ -4,13 +4,14 @@ DBA CDB_MAKE handler test magic_quotes_runtime=1 --SKIPIF-- --FILE-- --FILE-- --FILE-- --EXPECT-- diff --git a/ext/dba/tests/dba_db3.phpt b/ext/dba/tests/dba_db3.phpt index e63b2da3e1..aa389d5f26 100644 --- a/ext/dba/tests/dba_db3.phpt +++ b/ext/dba/tests/dba_db3.phpt @@ -2,13 +2,13 @@ DBA DB3 handler test --SKIPIF-- --FILE-- --EXPECT-- diff --git a/ext/dba/tests/dba_db4.phpt b/ext/dba/tests/dba_db4.phpt index 1f94e0d3ac..fc5b3171f8 100644 --- a/ext/dba/tests/dba_db4.phpt +++ b/ext/dba/tests/dba_db4.phpt @@ -2,13 +2,13 @@ DBA DB4 handler test --SKIPIF-- --FILE-- --EXPECT-- diff --git a/ext/dba/tests/dba_dbm.phpt b/ext/dba/tests/dba_dbm.phpt index 937d31d0d8..e751cf60cf 100644 --- a/ext/dba/tests/dba_dbm.phpt +++ b/ext/dba/tests/dba_dbm.phpt @@ -2,13 +2,13 @@ DBA DBM handler test --SKIPIF-- --FILE-- --EXPECT-- diff --git a/ext/dba/tests/dba_flatfile.phpt b/ext/dba/tests/dba_flatfile.phpt index 42477dfd3c..8e259cb965 100644 --- a/ext/dba/tests/dba_flatfile.phpt +++ b/ext/dba/tests/dba_flatfile.phpt @@ -2,13 +2,13 @@ DBA FlatFile handler test --SKIPIF-- --FILE-- --EXPECT-- diff --git a/ext/dba/tests/dba_gdbm.phpt b/ext/dba/tests/dba_gdbm.phpt index c7eb5f9978..b5d3c19ccd 100644 --- a/ext/dba/tests/dba_gdbm.phpt +++ b/ext/dba/tests/dba_gdbm.phpt @@ -2,13 +2,13 @@ DBA GDBM handler test --SKIPIF-- --FILE-- --FILE-- --EXPECT-- diff --git a/ext/dba/tests/skipif.inc b/ext/dba/tests/skipif.inc index 141c907111..5612e682a3 100644 --- a/ext/dba/tests/skipif.inc +++ b/ext/dba/tests/skipif.inc @@ -2,19 +2,22 @@ if (!extension_loaded('dba')) die('skip dba extension not available'); if (!function_exists('dba_handlers')) die ('skip dba_handlers() not available'); if (!sizeof(dba_handlers())) die('skip no handlers installed'); - $handler = dba_handlers(); - if (in_array('flatfile', $handler)) { - $handler = 'flatfile'; - } elseif ($handler[0]=='cdb') { // CDB currently supports only reading - if (count($handler)==1) { - die('skip CDB currently supports only reading'); + if (!isset($handler)) { + $handlers = dba_handlers(); + 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'); + } + $handler = array_shift($handler); } - if ($handler[1]=='cdb_make' && count($handler)==2) { - die('skip CDB currently supports only reading and creating'); - } - $handler = $handler[1]; } else { - $handler = $handler[0]; + if (!in_array($handler, dba_handlers())) { + $HND = strtoupper($handler); + die("skip $HND handler not available"); + } } $HND = strtoupper($handler); ?> diff --git a/ext/dba/tests/test.inc b/ext/dba/tests/test.inc index 402096dbe9..04f954541c 100644 --- a/ext/dba/tests/test.inc +++ b/ext/dba/tests/test.inc @@ -1,17 +1,7 @@