cvs: php4(PHP_4_3) /ext/dba/tests dba_cdb.phpt dba_cdb_make.phpt dba_cdb_read.phpt dba_db2.phpt dba_db3.phpt dba_db4.phpt dba_dbm.phpt
dba_flatfile.phpt dba_gdbm.phpt dba_ndbm.phpt skipif.inc test.inc
| From: | Marcus Boerger | Date: | Tue, 06 May 2003 01:26:21 +0000 |
| Subject: | cvs: php4(PHP_4_3) /ext/dba/tests dba_cdb.phpt dba_cdb_make.phpt dba_cdb_read.phpt dba_db2.phpt dba_db3.phpt dba_db4.phpt dba_dbm.phpt dba_flatfile.phpt dba_gdbm.phpt dba_ndbm.phpt skipif.inc test.inc |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20724@lists.php.net to get a copy of this message | ||
helly Mon May 5 21:26:21 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/dba/tests dba_cdb.phpt dba_cdb_make.phpt
dba_cdb_read.phpt dba_db2.phpt dba_db3.phpt
dba_db4.phpt dba_dbm.phpt dba_flatfile.phpt
dba_gdbm.phpt dba_ndbm.phpt skipif.inc test.inc
Log:
MFH new test layout
Index: php4/ext/dba/tests/dba_cdb.phpt diff -u php4/ext/dba/tests/dba_cdb.phpt:1.4.2.2 php4/ext/dba/tests/dba_cdb.phpt:1.4.2.3 --- php4/ext/dba/tests/dba_cdb.phpt:1.4.2.2 Fri Dec 20 15:25:19 2002 +++ php4/ext/dba/tests/dba_cdb.phpt Mon May 5 21:26:21 2003 @@ -2,14 +2,14 @@ DBA CDB handler test --SKIPIF-- <?php + $handler = 'cdb'; require_once('skipif.inc'); - if (!in_array('cdb', dba_handlers())) die('skip CDB handler not available'); die('info CDB does not support replace or delete'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'cdb'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_cdb_make.phpt diff -u php4/ext/dba/tests/dba_cdb_make.phpt:1.1.2.1 php4/ext/dba/tests/dba_cdb_make.phpt:1.1.2.2 --- php4/ext/dba/tests/dba_cdb_make.phpt:1.1.2.1 Thu Nov 14 16:52:22 2002 +++ php4/ext/dba/tests/dba_cdb_make.phpt Mon May 5 21:26:21 2003 @@ -4,13 +4,14 @@ magic_quotes_runtime=1 --SKIPIF-- <?php + $handler = 'cdb_make'; require_once('skipif.inc'); - if (!in_array('cdb_make', dba_handlers())) die('skip CDB_MAKE handler not available'); + die('info CDB_MAKE does not support reading'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'cdb_make'; + require_once('test.inc'); echo "database handler: $handler\n"; // print md5 checksum of test.cdb which is generated by cdb_make program var_dump(md5(implode('',file(dirname(__FILE__).'/test.cdb')))); Index: php4/ext/dba/tests/dba_cdb_read.phpt diff -u php4/ext/dba/tests/dba_cdb_read.phpt:1.4 php4/ext/dba/tests/dba_cdb_read.phpt:1.4.2.1 --- php4/ext/dba/tests/dba_cdb_read.phpt:1.4 Mon Nov 4 12:53:04 2002 +++ php4/ext/dba/tests/dba_cdb_read.phpt Mon May 5 21:26:21 2003 @@ -2,8 +2,8 @@ DBA CDB handler test (read only) --SKIPIF-- <?php - if (!extension_loaded('dba')) die('skip dba extension not available'); - if (!in_array('cdb', dba_handlers())) die('skip CDB handler not available'); + $handler = 'cdb_make'; + require_once('skipif.inc'); ?> --FILE-- <?php Index: php4/ext/dba/tests/dba_db2.phpt diff -u php4/ext/dba/tests/dba_db2.phpt:1.2.2.1 php4/ext/dba/tests/dba_db2.phpt:1.2.2.2 --- php4/ext/dba/tests/dba_db2.phpt:1.2.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_db2.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA DB2 handler test --SKIPIF-- <?php + $handler = 'db2'; require_once('skipif.inc'); - if (!in_array('db2', dba_handlers())) die('skip DB2 handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'db2'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_db3.phpt diff -u php4/ext/dba/tests/dba_db3.phpt:1.2.2.1 php4/ext/dba/tests/dba_db3.phpt:1.2.2.2 --- php4/ext/dba/tests/dba_db3.phpt:1.2.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_db3.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA DB3 handler test --SKIPIF-- <?php + $handler = 'db3'; require_once('skipif.inc'); - if (!in_array('db3', dba_handlers())) die('skip DB3 handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'db3'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_db4.phpt diff -u php4/ext/dba/tests/dba_db4.phpt:1.1.2.1 php4/ext/dba/tests/dba_db4.phpt:1.1.2.2 --- php4/ext/dba/tests/dba_db4.phpt:1.1.2.1 Mon Dec 30 14:13:45 2002 +++ php4/ext/dba/tests/dba_db4.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA DB4 handler test --SKIPIF-- <?php + $handler = 'db4'; require_once('skipif.inc'); - if (!in_array('db4', dba_handlers())) die('skip DB4 handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'db4'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_dbm.phpt diff -u php4/ext/dba/tests/dba_dbm.phpt:1.2.2.1 php4/ext/dba/tests/dba_dbm.phpt:1.2.2.2 --- php4/ext/dba/tests/dba_dbm.phpt:1.2.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_dbm.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA DBM handler test --SKIPIF-- <?php + $handler = 'dbm'; require_once('skipif.inc'); - if (!in_array('dbm', dba_handlers())) die('skip DBM handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'dbm'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_flatfile.phpt diff -u php4/ext/dba/tests/dba_flatfile.phpt:1.2.2.1 php4/ext/dba/tests/dba_flatfile.phpt:1.2.2.2 --- php4/ext/dba/tests/dba_flatfile.phpt:1.2.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_flatfile.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA FlatFile handler test --SKIPIF-- <?php + $handler = 'flatfile'; require_once('skipif.inc'); - if (!in_array('flatfile', dba_handlers())) die('skip FlatFile handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'flatfile'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_gdbm.phpt diff -u php4/ext/dba/tests/dba_gdbm.phpt:1.3.2.1 php4/ext/dba/tests/dba_gdbm.phpt:1.3.2.2 --- php4/ext/dba/tests/dba_gdbm.phpt:1.3.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_gdbm.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA GDBM handler test --SKIPIF-- <?php + $handler = 'gdbm'; require_once('skipif.inc'); - if (!in_array('gdbm', dba_handlers())) die('skip GDBM handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'gdbm'; + require_once('test.inc'); $lock_flag = ''; // lock in library require_once('dba_handler.inc'); Index: php4/ext/dba/tests/dba_ndbm.phpt diff -u php4/ext/dba/tests/dba_ndbm.phpt:1.2.2.1 php4/ext/dba/tests/dba_ndbm.phpt:1.2.2.2 --- php4/ext/dba/tests/dba_ndbm.phpt:1.2.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_ndbm.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA NDBM handler test --SKIPIF-- <?php + $handler = 'ndbm'; require_once('skipif.inc'); - if (!in_array('ndbm', dba_handlers())) die('skip NDBM handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'ndbm'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/skipif.inc diff -u php4/ext/dba/tests/skipif.inc:1.3.2.1 php4/ext/dba/tests/skipif.inc:1.3.2.2 --- php4/ext/dba/tests/skipif.inc:1.3.2.1 Fri Nov 15 11:39:36 2002 +++ php4/ext/dba/tests/skipif.inc Mon May 5 21:26:21 2003 @@ -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); ?> Index: php4/ext/dba/tests/test.inc diff -u php4/ext/dba/tests/test.inc:1.7.2.1 php4/ext/dba/tests/test.inc:1.7.2.2 --- php4/ext/dba/tests/test.inc:1.7.2.1 Fri Nov 15 11:39:36 2002 +++ php4/ext/dba/tests/test.inc Mon May 5 21:26:21 2003 @@ -1,17 +1,7 @@ <?php - $db_filename = $db_file = dirname(__FILE__).'/test0.dbm'; - $handler = dba_handlers(); - if (in_array('flatfile', $handler)) { - $handler = 'flatfile'; - } elseif ($handler[0]=='cdb') { // CDB currently supports only reading - if (count($handler)==1) { - die('CDB currently supports only reading '); - } - $handler = $handler[1]; - } else { - $handler = $handler[0]; - } + require_once('skipif.inc'); $lock_flag = 'l'; + $db_filename = $db_file = dirname(__FILE__).'/test0.dbm'; @unlink($db_filename); @unlink($db_filename.'.lck'); ?>
Index: php4/ext/dba/tests/dba_cdb.phpt diff -u php4/ext/dba/tests/dba_cdb.phpt:1.4.2.2 php4/ext/dba/tests/dba_cdb.phpt:1.4.2.3 --- php4/ext/dba/tests/dba_cdb.phpt:1.4.2.2 Fri Dec 20 15:25:19 2002 +++ php4/ext/dba/tests/dba_cdb.phpt Mon May 5 21:26:21 2003 @@ -2,14 +2,14 @@ DBA CDB handler test --SKIPIF-- <?php + $handler = 'cdb'; require_once('skipif.inc'); - if (!in_array('cdb', dba_handlers())) die('skip CDB handler not available'); die('info CDB does not support replace or delete'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'cdb'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_cdb_make.phpt diff -u php4/ext/dba/tests/dba_cdb_make.phpt:1.1.2.1 php4/ext/dba/tests/dba_cdb_make.phpt:1.1.2.2 --- php4/ext/dba/tests/dba_cdb_make.phpt:1.1.2.1 Thu Nov 14 16:52:22 2002 +++ php4/ext/dba/tests/dba_cdb_make.phpt Mon May 5 21:26:21 2003 @@ -4,13 +4,14 @@ magic_quotes_runtime=1 --SKIPIF-- <?php + $handler = 'cdb_make'; require_once('skipif.inc'); - if (!in_array('cdb_make', dba_handlers())) die('skip CDB_MAKE handler not available'); + die('info CDB_MAKE does not support reading'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'cdb_make'; + require_once('test.inc'); echo "database handler: $handler\n"; // print md5 checksum of test.cdb which is generated by cdb_make program var_dump(md5(implode('',file(dirname(__FILE__).'/test.cdb')))); Index: php4/ext/dba/tests/dba_cdb_read.phpt diff -u php4/ext/dba/tests/dba_cdb_read.phpt:1.4 php4/ext/dba/tests/dba_cdb_read.phpt:1.4.2.1 --- php4/ext/dba/tests/dba_cdb_read.phpt:1.4 Mon Nov 4 12:53:04 2002 +++ php4/ext/dba/tests/dba_cdb_read.phpt Mon May 5 21:26:21 2003 @@ -2,8 +2,8 @@ DBA CDB handler test (read only) --SKIPIF-- <?php - if (!extension_loaded('dba')) die('skip dba extension not available'); - if (!in_array('cdb', dba_handlers())) die('skip CDB handler not available'); + $handler = 'cdb_make'; + require_once('skipif.inc'); ?> --FILE-- <?php Index: php4/ext/dba/tests/dba_db2.phpt diff -u php4/ext/dba/tests/dba_db2.phpt:1.2.2.1 php4/ext/dba/tests/dba_db2.phpt:1.2.2.2 --- php4/ext/dba/tests/dba_db2.phpt:1.2.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_db2.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA DB2 handler test --SKIPIF-- <?php + $handler = 'db2'; require_once('skipif.inc'); - if (!in_array('db2', dba_handlers())) die('skip DB2 handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'db2'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_db3.phpt diff -u php4/ext/dba/tests/dba_db3.phpt:1.2.2.1 php4/ext/dba/tests/dba_db3.phpt:1.2.2.2 --- php4/ext/dba/tests/dba_db3.phpt:1.2.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_db3.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA DB3 handler test --SKIPIF-- <?php + $handler = 'db3'; require_once('skipif.inc'); - if (!in_array('db3', dba_handlers())) die('skip DB3 handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'db3'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_db4.phpt diff -u php4/ext/dba/tests/dba_db4.phpt:1.1.2.1 php4/ext/dba/tests/dba_db4.phpt:1.1.2.2 --- php4/ext/dba/tests/dba_db4.phpt:1.1.2.1 Mon Dec 30 14:13:45 2002 +++ php4/ext/dba/tests/dba_db4.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA DB4 handler test --SKIPIF-- <?php + $handler = 'db4'; require_once('skipif.inc'); - if (!in_array('db4', dba_handlers())) die('skip DB4 handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'db4'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_dbm.phpt diff -u php4/ext/dba/tests/dba_dbm.phpt:1.2.2.1 php4/ext/dba/tests/dba_dbm.phpt:1.2.2.2 --- php4/ext/dba/tests/dba_dbm.phpt:1.2.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_dbm.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA DBM handler test --SKIPIF-- <?php + $handler = 'dbm'; require_once('skipif.inc'); - if (!in_array('dbm', dba_handlers())) die('skip DBM handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'dbm'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_flatfile.phpt diff -u php4/ext/dba/tests/dba_flatfile.phpt:1.2.2.1 php4/ext/dba/tests/dba_flatfile.phpt:1.2.2.2 --- php4/ext/dba/tests/dba_flatfile.phpt:1.2.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_flatfile.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA FlatFile handler test --SKIPIF-- <?php + $handler = 'flatfile'; require_once('skipif.inc'); - if (!in_array('flatfile', dba_handlers())) die('skip FlatFile handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'flatfile'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/dba_gdbm.phpt diff -u php4/ext/dba/tests/dba_gdbm.phpt:1.3.2.1 php4/ext/dba/tests/dba_gdbm.phpt:1.3.2.2 --- php4/ext/dba/tests/dba_gdbm.phpt:1.3.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_gdbm.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA GDBM handler test --SKIPIF-- <?php + $handler = 'gdbm'; require_once('skipif.inc'); - if (!in_array('gdbm', dba_handlers())) die('skip GDBM handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'gdbm'; + require_once('test.inc'); $lock_flag = ''; // lock in library require_once('dba_handler.inc'); Index: php4/ext/dba/tests/dba_ndbm.phpt diff -u php4/ext/dba/tests/dba_ndbm.phpt:1.2.2.1 php4/ext/dba/tests/dba_ndbm.phpt:1.2.2.2 --- php4/ext/dba/tests/dba_ndbm.phpt:1.2.2.1 Thu Nov 14 09:40:43 2002 +++ php4/ext/dba/tests/dba_ndbm.phpt Mon May 5 21:26:21 2003 @@ -2,13 +2,13 @@ DBA NDBM handler test --SKIPIF-- <?php + $handler = 'ndbm'; require_once('skipif.inc'); - if (!in_array('ndbm', dba_handlers())) die('skip NDBM handler not available'); ?> --FILE-- <?php - require_once('test.inc'); $handler = 'ndbm'; + require_once('test.inc'); require_once('dba_handler.inc'); ?> --EXPECT-- Index: php4/ext/dba/tests/skipif.inc diff -u php4/ext/dba/tests/skipif.inc:1.3.2.1 php4/ext/dba/tests/skipif.inc:1.3.2.2 --- php4/ext/dba/tests/skipif.inc:1.3.2.1 Fri Nov 15 11:39:36 2002 +++ php4/ext/dba/tests/skipif.inc Mon May 5 21:26:21 2003 @@ -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); ?> Index: php4/ext/dba/tests/test.inc diff -u php4/ext/dba/tests/test.inc:1.7.2.1 php4/ext/dba/tests/test.inc:1.7.2.2 --- php4/ext/dba/tests/test.inc:1.7.2.1 Fri Nov 15 11:39:36 2002 +++ php4/ext/dba/tests/test.inc Mon May 5 21:26:21 2003 @@ -1,17 +1,7 @@ <?php - $db_filename = $db_file = dirname(__FILE__).'/test0.dbm'; - $handler = dba_handlers(); - if (in_array('flatfile', $handler)) { - $handler = 'flatfile'; - } elseif ($handler[0]=='cdb') { // CDB currently supports only reading - if (count($handler)==1) { - die('CDB currently supports only reading '); - } - $handler = $handler[1]; - } else { - $handler = $handler[0]; - } + require_once('skipif.inc'); $lock_flag = 'l'; + $db_filename = $db_file = dirname(__FILE__).'/test0.dbm'; @unlink($db_filename); @unlink($db_filename.'.lck'); ?>