diff options
Diffstat (limited to 'ext/dba/tests')
-rw-r--r-- | ext/dba/tests/dba001.phpt | 21 | ||||
-rw-r--r-- | ext/dba/tests/dba002.phpt | 22 | ||||
-rw-r--r-- | ext/dba/tests/dba003.phpt | 24 | ||||
-rw-r--r-- | ext/dba/tests/dba004.phpt | 28 | ||||
-rw-r--r-- | ext/dba/tests/dba005.phpt | 35 | ||||
-rw-r--r-- | ext/dba/tests/dba006.phpt | 37 | ||||
-rw-r--r-- | ext/dba/tests/dba007.phpt | 45 | ||||
-rw-r--r-- | ext/dba/tests/dba008.phpt | 32 | ||||
-rw-r--r-- | ext/dba/tests/dba_cdb.phpt | 30 | ||||
-rw-r--r-- | ext/dba/tests/dba_cdb_make.phpt | 37 | ||||
-rw-r--r-- | ext/dba/tests/dba_cdb_read.phpt | 65 | ||||
-rw-r--r-- | ext/dba/tests/dba_db2.phpt | 29 | ||||
-rw-r--r-- | ext/dba/tests/dba_db3.phpt | 29 | ||||
-rw-r--r-- | ext/dba/tests/dba_db4.phpt | 29 | ||||
-rw-r--r-- | ext/dba/tests/dba_dbm.phpt | 29 | ||||
-rw-r--r-- | ext/dba/tests/dba_flatfile.phpt | 29 | ||||
-rw-r--r-- | ext/dba/tests/dba_gdbm.phpt | 32 | ||||
-rw-r--r-- | ext/dba/tests/dba_handler.inc | 75 | ||||
-rw-r--r-- | ext/dba/tests/dba_inifile.phpt | 29 | ||||
-rw-r--r-- | ext/dba/tests/dba_ndbm.phpt | 29 | ||||
-rw-r--r-- | ext/dba/tests/skipif.inc | 20 | ||||
-rw-r--r-- | ext/dba/tests/test.cdb | bin | 2230 -> 0 bytes | |||
-rw-r--r-- | ext/dba/tests/test.inc | 17 |
23 files changed, 0 insertions, 723 deletions
diff --git a/ext/dba/tests/dba001.phpt b/ext/dba/tests/dba001.phpt deleted file mode 100644 index 3d617fb2c2..0000000000 --- a/ext/dba/tests/dba001.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -DBA File Creation Test ---SKIPIF-- -<?php - require_once('skipif.inc'); - die("info $HND handler used"); -?> ---FILE-- -<?php - require_once('test.inc'); - echo "database handler: $handler\n"; - if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { - echo "database file created\n"; - dba_close($db_file); - } else { - echo "$db_file does not exist\n"; - } -?> ---EXPECTF-- -database handler: %s -database file created
\ No newline at end of file diff --git a/ext/dba/tests/dba002.phpt b/ext/dba/tests/dba002.phpt deleted file mode 100644 index 3f862e38c5..0000000000 --- a/ext/dba/tests/dba002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -DBA Insert/Fetch Test ---SKIPIF-- -<?php - require_once('skipif.inc'); - die("info $HND handler used"); -?> ---FILE-- -<?php - require_once('test.inc'); - echo "database handler: $handler\n"; - if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { - dba_insert("key1", "This is a test insert", $db_file); - echo dba_fetch("key1", $db_file); - dba_close($db_file); - } else { - echo "Error creating database\n"; - } -?> ---EXPECTF-- -database handler: %s -This is a test insert diff --git a/ext/dba/tests/dba003.phpt b/ext/dba/tests/dba003.phpt deleted file mode 100644 index 617ae91891..0000000000 --- a/ext/dba/tests/dba003.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -DBA Insert/Replace/Fetch Test ---SKIPIF-- -<?php - require_once('skipif.inc'); - die("info $HND handler used"); -?> ---FILE-- -<?php - require_once('test.inc'); - echo "database handler: $handler\n"; - if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { - dba_insert("key1", "This is a test insert", $db_file); - dba_replace("key1", "This is the replacement text", $db_file); - $a = dba_fetch("key1", $db_file); - dba_close($db_file); - echo $a; - } else { - echo "Error creating database\n"; - } -?> ---EXPECTF-- -database handler: %s -This is the replacement text diff --git a/ext/dba/tests/dba004.phpt b/ext/dba/tests/dba004.phpt deleted file mode 100644 index 3b1f29c7dd..0000000000 --- a/ext/dba/tests/dba004.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -DBA Multiple Insert/Fetch Test ---SKIPIF-- -<?php - require_once('skipif.inc'); - die("info $HND handler used"); -?> ---FILE-- -<?php - require_once('test.inc'); - echo "database handler: $handler\n"; - if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { - dba_insert("key1", "Content String 1", $db_file); - dba_insert("key2", "Content String 2", $db_file); - dba_insert("key3", "Third Content String", $db_file); - dba_insert("key4", "Another Content String", $db_file); - dba_insert("key5", "The last content string", $db_file); - $a = dba_fetch("key4", $db_file); - $b = dba_fetch("key2", $db_file); - dba_close($db_file); - echo "$a $b"; - } else { - echo "Error creating database\n"; - } -?> ---EXPECTF-- -database handler: %s -Another Content String Content String 2 diff --git a/ext/dba/tests/dba005.phpt b/ext/dba/tests/dba005.phpt deleted file mode 100644 index 5a933c48f9..0000000000 --- a/ext/dba/tests/dba005.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -DBA FirstKey/NextKey Loop Test With 5 Items ---SKIPIF-- -<?php - require_once('skipif.inc'); - die("info $HND handler used"); -?> ---FILE-- -<?php - require_once('test.inc'); - echo "database handler: $handler\n"; - if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { - dba_insert("key1", "Content String 1", $db_file); - dba_insert("key2", "Content String 2", $db_file); - dba_insert("key3", "Third Content String", $db_file); - dba_insert("key4", "Another Content String", $db_file); - dba_insert("key5", "The last content string", $db_file); - $a = dba_firstkey($db_file); - $i=0; - while($a) { - $a = dba_nextkey($db_file); - $i++; - } - echo $i; - for ($i=1; $i<6; $i++) { - echo dba_exists("key$i", $db_file) ? "Y" : "N"; - } - dba_close($db_file); - } else { - echo "Error creating database\n"; - } -?> ---EXPECTF-- -database handler: %s -5YYYYY diff --git a/ext/dba/tests/dba006.phpt b/ext/dba/tests/dba006.phpt deleted file mode 100644 index efa36a5d07..0000000000 --- a/ext/dba/tests/dba006.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -DBA FirstKey/NextKey with 2 deletes ---SKIPIF-- -<?php - require_once('skipif.inc'); - die("info $HND handler used"); -?> ---FILE-- -<?php - require_once('test.inc'); - echo "database handler: $handler\n"; - if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { - dba_insert("key1", "Content String 1", $db_file); - dba_insert("key2", "Content String 2", $db_file); - dba_insert("key3", "Third Content String", $db_file); - dba_insert("key4", "Another Content String", $db_file); - dba_insert("key5", "The last content string", $db_file); - dba_delete("key3", $db_file); - dba_delete("key1", $db_file); - $a = dba_firstkey($db_file); - $i=0; - while($a) { - $a = dba_nextkey($db_file); - $i++; - } - echo $i; - for ($i=1; $i<6; $i++) { - echo dba_exists("key$i", $db_file) ? "Y" : "N"; - } - dba_close($db_file); - } else { - echo "Error creating database\n"; - } -?> ---EXPECTF-- -database handler: %s -3NYNYY
\ No newline at end of file diff --git a/ext/dba/tests/dba007.phpt b/ext/dba/tests/dba007.phpt deleted file mode 100644 index 0add3809aa..0000000000 --- a/ext/dba/tests/dba007.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -DBA Multiple File Creation Test ---SKIPIF-- -<?php - require_once('skipif.inc'); - if (!function_exists('dba_list')) die('skip dba_list() not available'); - die("info $HND handler used"); -?> ---FILE-- -<?php - require_once('test.inc'); - echo "database handler: $handler\n"; - $db_file1 = dirname(__FILE__).'/test1.dbm'; - $db_file2 = dirname(__FILE__).'/test2.dbm'; - if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { - echo "database file created\n"; - } else { - echo "$db_file does not exist\n"; - } - if (($db_file1=dba_open($db_file1, "n", $handler))!==FALSE) { - echo "database file created\n"; - } else { - echo "$db_file does not exist\n"; - } - if (($db_file2=dba_open($db_file2, "n", $handler))!==FALSE) { - echo "database file created\n"; - } else { - echo "$db_file does not exist\n"; - } - var_dump(dba_list()); - dba_close($db_file); -?> ---EXPECTF-- -database handler: %s -database file created -database file created -database file created -array(3) { - [%d]=> - string(%d) "%sext/dba/tests/test0.dbm" - [%d]=> - string(%d) "%sext/dba/tests/test1.dbm" - [%d]=> - string(%d) "%sext/dba/tests/test2.dbm" -}
\ No newline at end of file diff --git a/ext/dba/tests/dba008.phpt b/ext/dba/tests/dba008.phpt deleted file mode 100644 index 84a47ba083..0000000000 --- a/ext/dba/tests/dba008.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -DBA magic_quotes_runtime Test ---SKIPIF-- -<?php - require_once('skipif.inc'); - die("info $HND handler used"); -?> ---FILE-- -<?php - require_once('test.inc'); - echo "database handler: $handler\n"; - if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { - ini_set('magic_quotes_runtime', 0); - dba_insert("key1", '"', $db_file); - var_dump(dba_fetch("key1", $db_file)); - ini_set('magic_quotes_runtime', 1); - var_dump(dba_fetch("key1", $db_file)); - dba_replace("key1", '\"', $db_file); - var_dump(dba_fetch("key1", $db_file)); - ini_set('magic_quotes_runtime', 0); - var_dump(dba_fetch("key1", $db_file)); - dba_close($db_file); - } else { - echo "Error creating database\n"; - } -?> ---EXPECTF-- -database handler: %s -string(1) """ -string(2) "\"" -string(2) "\"" -string(1) """ diff --git a/ext/dba/tests/dba_cdb.phpt b/ext/dba/tests/dba_cdb.phpt deleted file mode 100644 index 9a881706ee..0000000000 --- a/ext/dba/tests/dba_cdb.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -DBA CDB handler test ---SKIPIF-- -<?php - 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('dba_handler.inc'); -?> ---EXPECT-- -database handler: cdb -5YYYYY -Content String 2 -array(5) { - ["key1"]=> - string(16) "Content String 1" - ["key2"]=> - string(16) "Content String 2" - ["key3"]=> - string(20) "Third Content String" - ["key4"]=> - string(22) "Another Content String" - ["key5"]=> - string(23) "The last content string" -} diff --git a/ext/dba/tests/dba_cdb_make.phpt b/ext/dba/tests/dba_cdb_make.phpt deleted file mode 100644 index 40a417860c..0000000000 --- a/ext/dba/tests/dba_cdb_make.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -DBA CDB_MAKE handler test ---INI-- -magic_quotes_runtime=1 ---SKIPIF-- -<?php - require_once('skipif.inc'); - if (!in_array('cdb_make', dba_handlers())) die('skip CDB_MAKE handler not available'); -?> ---FILE-- -<?php - require_once('test.inc'); - $handler = 'cdb_make'; - 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')))); - if (($db_make=dba_open($db_file, "n", $handler))!==FALSE) { - dba_insert("1", "1", $db_make); - dba_insert("2", "2", $db_make); - dba_insert("1", "3", $db_make); - dba_insert("2", "1", $db_make); - dba_insert("3", "3", $db_make); - dba_insert("1", "2", $db_make); - dba_insert("4", "4", $db_make); -// dba_replace cdb_make doesn't know replace - dba_close($db_make); - // write md5 checksum of generated database file - var_dump(md5(implode('',file($db_file)))); - // no need to test created database: this is done by dba_cdb_read.phpt - } else { - echo "Error creating database\n"; - } -?> ---EXPECT-- -database handler: cdb_make -string(32) "723d19f39c1b15b3b455dd64323148d1" -string(32) "723d19f39c1b15b3b455dd64323148d1"
\ No newline at end of file diff --git a/ext/dba/tests/dba_cdb_read.phpt b/ext/dba/tests/dba_cdb_read.phpt deleted file mode 100644 index 573a58cee3..0000000000 --- a/ext/dba/tests/dba_cdb_read.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -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'); -?> ---FILE-- -<?php - echo "database handler: cdb\n"; - $handler = 'cdb'; - $db_file = dirname(__FILE__).'/test.cdb'; - if (($db_file=dba_open($db_file, "r", $handler))!==FALSE) { - // read key sequence - $a = dba_firstkey($db_file); - $count= 0; - $keys = $a; - while($a) { - $a = dba_nextkey($db_file); - $keys .= $a; - $count++; - } - // display number of entries and key existance - echo $count; - for ($i=1; $i<8; $i++) { - echo dba_exists($i, $db_file) ? "Y" : "N"; - } - echo "\n="; - echo dba_fetch(1, $db_file); - echo dba_fetch(2, $db_file); - echo dba_fetch(3, $db_file); - echo dba_fetch(4, $db_file); - echo "\n#"; - echo dba_fetch(1, $db_file); - echo dba_fetch(1, $db_file); - echo dba_fetch(2, $db_file); - echo dba_fetch(2, $db_file); - echo "\n?".$keys; - // with skip = 0 dba_fetch must fetch the first result - echo "\n#"; - $skip = array(); - for ($i=0; $i < strlen($keys); $i++) { - $key = substr($keys, $i, 1); - $skip[$key] = 0; - echo dba_fetch($key, $db_file); - } - echo "\n="; - for ($i=0; $i < strlen($keys); $i++) { - $key = substr($keys, $i, 1); - echo dba_fetch($key, $skip[$key], $db_file); - $skip[$key]++; - } - dba_close($db_file); - } else { - echo "Error creating database\n"; - } -?> ---EXPECT-- -database handler: cdb -7YYYYNNN -=1234 -#1122 -?1212314 -#1212314 -=1231324
\ No newline at end of file diff --git a/ext/dba/tests/dba_db2.phpt b/ext/dba/tests/dba_db2.phpt deleted file mode 100644 index 154ea32111..0000000000 --- a/ext/dba/tests/dba_db2.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -DBA DB2 handler test ---SKIPIF-- -<?php - 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('dba_handler.inc'); -?> ---EXPECT-- -database handler: db2 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -}
\ No newline at end of file diff --git a/ext/dba/tests/dba_db3.phpt b/ext/dba/tests/dba_db3.phpt deleted file mode 100644 index e63b2da3e1..0000000000 --- a/ext/dba/tests/dba_db3.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -DBA DB3 handler test ---SKIPIF-- -<?php - 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('dba_handler.inc'); -?> ---EXPECT-- -database handler: db3 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -}
\ No newline at end of file diff --git a/ext/dba/tests/dba_db4.phpt b/ext/dba/tests/dba_db4.phpt deleted file mode 100644 index 1f94e0d3ac..0000000000 --- a/ext/dba/tests/dba_db4.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -DBA DB4 handler test ---SKIPIF-- -<?php - 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('dba_handler.inc'); -?> ---EXPECT-- -database handler: db4 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} diff --git a/ext/dba/tests/dba_dbm.phpt b/ext/dba/tests/dba_dbm.phpt deleted file mode 100644 index 937d31d0d8..0000000000 --- a/ext/dba/tests/dba_dbm.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -DBA DBM handler test ---SKIPIF-- -<?php - 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('dba_handler.inc'); -?> ---EXPECT-- -database handler: dbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} diff --git a/ext/dba/tests/dba_flatfile.phpt b/ext/dba/tests/dba_flatfile.phpt deleted file mode 100644 index 42477dfd3c..0000000000 --- a/ext/dba/tests/dba_flatfile.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -DBA FlatFile handler test ---SKIPIF-- -<?php - 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('dba_handler.inc'); -?> ---EXPECT-- -database handler: flatfile -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -}
\ No newline at end of file diff --git a/ext/dba/tests/dba_gdbm.phpt b/ext/dba/tests/dba_gdbm.phpt deleted file mode 100644 index c7eb5f9978..0000000000 --- a/ext/dba/tests/dba_gdbm.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -DBA GDBM handler test ---SKIPIF-- -<?php - require_once('skipif.inc'); - if (!in_array('gdbm', dba_handlers())) die('skip GDBM handler not available'); -?> ---FILE-- -<?php - require_once('test.inc'); - $handler = 'gdbm'; - $lock_flag = ''; // lock in library - require_once('dba_handler.inc'); - - // Read during write is system dependant. Important is that there is no deadlock -?> ---EXPECTF-- -database handler: gdbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write:%sallowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -}
\ No newline at end of file diff --git a/ext/dba/tests/dba_handler.inc b/ext/dba/tests/dba_handler.inc deleted file mode 100644 index b2e73d6237..0000000000 --- a/ext/dba/tests/dba_handler.inc +++ /dev/null @@ -1,75 +0,0 @@ -<?php - echo "database handler: $handler\n"; - if (($db_file = dba_open($db_filename, 'n'.$lock_flag, $handler))!==FALSE) { - dba_insert("key1", "Content String 1", $db_file); - dba_insert("key2", "Content String 2", $db_file); - dba_insert("key3", "Third Content String", $db_file); - dba_insert("key4", "Another Content String", $db_file); - dba_insert("key5", "The last content string", $db_file); - if ($handler != 'cdb') { - dba_delete("key3", $db_file); - dba_delete("key1", $db_file); - } else { - dba_close($db_file); - if (($db_file = dba_open($db_filename, 'r'.$lock_flag, $handler))===FALSE) { - echo "Error reopening database\n"; - } - } - $a = dba_firstkey($db_file); - $i=0; - while($a) { - $a = dba_nextkey($db_file); - $i++; - } - echo $i; - for ($i=1; $i<6; $i++) { - echo dba_exists("key$i", $db_file) ? "Y" : "N"; - } - echo "\n"; - echo dba_fetch("key2", $db_file)."\n"; - if ($handler != 'cdb') { - dba_replace("key2", "Content 2 replaced", $db_file); - echo dba_fetch("key2", $db_file)."\n"; - } - dba_close($db_file); - } else { - echo "Error creating database\n"; - } - if ($handler != 'cdb') { - $db_writer = dba_open($db_filename, 'w'.$lock_flag, $handler); - if (($dba_reader = @dba_open($db_filename, 'r'.$lock_flag.($lock_flag ? 't' : ''), $handler))===false) { - echo "Read during write: not allowed\n"; - } else { - echo "Read during write: allowed\n"; - } - if ($db_writer!==FALSE) { - dba_insert("key number 6", "The 6th value", $db_writer); - @dba_insert("key number 6", "The 6th value inserted again would be an error", $db_writer); - dba_replace("key2", "Content 2 replaced 2nd time", $db_writer); - dba_delete("key4", $db_writer); - echo dba_fetch("key2", $db_writer)."\n"; - echo dba_fetch("key number 6", $db_writer)."\n"; - dba_close($db_writer); // when the writer is open at least db3 would fail because of buffered io. - } else { - die("Error reopening database\n"); - } - } - if (($db_file = dba_open($db_filename, 'r'.$lock_flag, $handler))!==FALSE) { - $key = dba_firstkey($db_file); - $res = array(); - while($key) { - $res[$key] = dba_fetch($key, $db_file); - $key = dba_nextkey($db_file); - } - ksort($res); - var_dump($res); - dba_close($db_file); - } else { - echo "Error reading database\n"; - } - if (!empty($dba_reader)) { - dba_close($dba_reader); - } - if (($db_file = dba_popen($db_filename, 'r'.($handler!='gdbm'?'-':''), $handler))!==FALSE) { - } -?>
\ No newline at end of file diff --git a/ext/dba/tests/dba_inifile.phpt b/ext/dba/tests/dba_inifile.phpt deleted file mode 100644 index 5ccccbe238..0000000000 --- a/ext/dba/tests/dba_inifile.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -DBA INIFILE handler test ---SKIPIF-- -<?php - require_once('skipif.inc'); - if (!in_array('inifile', dba_handlers())) die('skip INIFILE handler not available'); -?> ---FILE-- -<?php - require_once('test.inc'); - $handler = 'inifile'; - require_once('dba_handler.inc'); -?> ---EXPECT-- -database handler: inifile -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -}
\ No newline at end of file diff --git a/ext/dba/tests/dba_ndbm.phpt b/ext/dba/tests/dba_ndbm.phpt deleted file mode 100644 index fd37b7bad2..0000000000 --- a/ext/dba/tests/dba_ndbm.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -DBA NDBM handler test ---SKIPIF-- -<?php - 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('dba_handler.inc'); -?> ---EXPECT-- -database handler: ndbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -}
\ No newline at end of file diff --git a/ext/dba/tests/skipif.inc b/ext/dba/tests/skipif.inc deleted file mode 100644 index 141c907111..0000000000 --- a/ext/dba/tests/skipif.inc +++ /dev/null @@ -1,20 +0,0 @@ -<?php - 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 ($handler[1]=='cdb_make' && count($handler)==2) { - die('skip CDB currently supports only reading and creating'); - } - $handler = $handler[1]; - } else { - $handler = $handler[0]; - } - $HND = strtoupper($handler); -?> diff --git a/ext/dba/tests/test.cdb b/ext/dba/tests/test.cdb Binary files differdeleted file mode 100644 index 21529c6280..0000000000 --- a/ext/dba/tests/test.cdb +++ /dev/null diff --git a/ext/dba/tests/test.inc b/ext/dba/tests/test.inc deleted file mode 100644 index 402096dbe9..0000000000 --- a/ext/dba/tests/test.inc +++ /dev/null @@ -1,17 +0,0 @@ -<?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]; - } - $lock_flag = 'l'; - @unlink($db_filename); - @unlink($db_filename.'.lck'); -?> |