summaryrefslogtreecommitdiff
path: root/ext/dba/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dba/tests')
-rw-r--r--ext/dba/tests/dba001.phpt21
-rw-r--r--ext/dba/tests/dba002.phpt22
-rw-r--r--ext/dba/tests/dba003.phpt24
-rw-r--r--ext/dba/tests/dba004.phpt28
-rw-r--r--ext/dba/tests/dba005.phpt35
-rw-r--r--ext/dba/tests/dba006.phpt37
-rw-r--r--ext/dba/tests/dba007.phpt45
-rw-r--r--ext/dba/tests/dba008.phpt32
-rwxr-xr-xext/dba/tests/dba009.phpt33
-rw-r--r--ext/dba/tests/dba_cdb.phpt47
-rw-r--r--ext/dba/tests/dba_cdb_make.phpt38
-rw-r--r--ext/dba/tests/dba_cdb_read.phpt65
-rw-r--r--ext/dba/tests/dba_db2.phpt46
-rw-r--r--ext/dba/tests/dba_db3.phpt46
-rw-r--r--ext/dba/tests/dba_db4.phpt46
-rw-r--r--ext/dba/tests/dba_dbm.phpt46
-rw-r--r--ext/dba/tests/dba_flatfile.phpt46
-rw-r--r--ext/dba/tests/dba_gdbm.phpt34
-rw-r--r--ext/dba/tests/dba_handler.inc87
-rw-r--r--ext/dba/tests/dba_inifile.phpt46
-rw-r--r--ext/dba/tests/dba_ndbm.phpt46
-rwxr-xr-xext/dba/tests/dba_qdbm.phpt34
-rw-r--r--ext/dba/tests/skipif.inc23
-rw-r--r--ext/dba/tests/test.cdbbin2230 -> 0 bytes
-rw-r--r--ext/dba/tests/test.inc7
25 files changed, 0 insertions, 934 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 577dacc68c..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) "%s/dba/tests/test0.dbm"
- [%d]=>
- string(%d) "%s/dba/tests/test1.dbm"
- [%d]=>
- string(%d) "%s/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/dba009.phpt b/ext/dba/tests/dba009.phpt
deleted file mode 100755
index 50a50c6bd5..0000000000
--- a/ext/dba/tests/dba009.phpt
+++ /dev/null
@@ -1,33 +0,0 @@
---TEST--
-DBA dba_popen Test
---SKIPIF--
-<?php
- require_once('skipif.inc');
- print("info $HND handler used");
-?>
---FILE--
-<?php
- require_once('test.inc');
- echo "database handler: $handler\n";
- if (($db=dba_popen($db_file, "n", $handler))!==FALSE) {
- echo "Opened\n";
- dba_insert("a", "Inserted", $db);
- echo dba_fetch("a", $db)."\n";
- dba_close($db);
- echo "Closed\n";
- } else {
- echo "Error creating database\n";
- }
- if (($db=dba_popen($db_file, "n", $handler))!==FALSE) {
- echo "Opened\n";
- dba_insert("a", "Inserted", $db);
- echo dba_fetch("a", $db)."\n";
- }
-?>
---EXPECTF--
-database handler: %s
-Opened
-Inserted
-Closed
-Opened
-Inserted
diff --git a/ext/dba/tests/dba_cdb.phpt b/ext/dba/tests/dba_cdb.phpt
deleted file mode 100644
index f3bf7975ea..0000000000
--- a/ext/dba/tests/dba_cdb.phpt
+++ /dev/null
@@ -1,47 +0,0 @@
---TEST--
-DBA CDB handler test
---SKIPIF--
-<?php
- $handler = 'cdb';
- require_once('skipif.inc');
- die('info CDB does not support replace or delete');
-?>
---FILE--
-<?php
- $handler = 'cdb';
- require_once('test.inc');
- require_once('dba_handler.inc');
-?>
-===DONE===
---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"
-}
---NO-LOCK--
-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"
-}
-===DONE===
diff --git a/ext/dba/tests/dba_cdb_make.phpt b/ext/dba/tests/dba_cdb_make.phpt
deleted file mode 100644
index 77f764dbe0..0000000000
--- a/ext/dba/tests/dba_cdb_make.phpt
+++ /dev/null
@@ -1,38 +0,0 @@
---TEST--
-DBA CDB_MAKE handler test
---INI--
-magic_quotes_runtime=1
---SKIPIF--
-<?php
- $handler = 'cdb_make';
- require_once('skipif.inc');
- die('info CDB_MAKE does not support reading');
-?>
---FILE--
-<?php
- $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'))));
- 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 a0fbe7bcca..0000000000
--- a/ext/dba/tests/dba_cdb_read.phpt
+++ /dev/null
@@ -1,65 +0,0 @@
---TEST--
-DBA CDB handler test (read only)
---SKIPIF--
-<?php
- $handler = 'cdb_make';
- require_once('skipif.inc');
-?>
---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 bcc5a94793..0000000000
--- a/ext/dba/tests/dba_db2.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-DBA DB2 handler test
---SKIPIF--
-<?php
- $handler = 'db2';
- require_once('skipif.inc');
-?>
---FILE--
-<?php
- $handler = 'db2';
- require_once('test.inc');
- require_once('dba_handler.inc');
-?>
-===DONE===
---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-LOCK--
-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"
-}
-===DONE===
diff --git a/ext/dba/tests/dba_db3.phpt b/ext/dba/tests/dba_db3.phpt
deleted file mode 100644
index c6d04cf02d..0000000000
--- a/ext/dba/tests/dba_db3.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-DBA DB3 handler test
---SKIPIF--
-<?php
- $handler = 'db3';
- require_once('skipif.inc');
-?>
---FILE--
-<?php
- $handler = 'db3';
- require_once('test.inc');
- require_once('dba_handler.inc');
-?>
-===DONE===
---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-LOCK--
-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"
-}
-===DONE===
diff --git a/ext/dba/tests/dba_db4.phpt b/ext/dba/tests/dba_db4.phpt
deleted file mode 100644
index fcf089a1e9..0000000000
--- a/ext/dba/tests/dba_db4.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-DBA DB4 handler test
---SKIPIF--
-<?php
- $handler = 'db4';
- require_once('skipif.inc');
-?>
---FILE--
-<?php
- $handler = 'db4';
- require_once('test.inc');
- require_once('dba_handler.inc');
-?>
-===DONE===
---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"
-}
---NO-LOCK--
-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"
-}
-===DONE===
diff --git a/ext/dba/tests/dba_dbm.phpt b/ext/dba/tests/dba_dbm.phpt
deleted file mode 100644
index fdd7b375f4..0000000000
--- a/ext/dba/tests/dba_dbm.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-DBA DBM handler test
---SKIPIF--
-<?php
- $handler = 'dbm';
- require_once('skipif.inc');
-?>
---FILE--
-<?php
- $handler = 'dbm';
- require_once('test.inc');
- require_once('dba_handler.inc');
-?>
-===DONE===
---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"
-}
---NO-LOCK--
-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"
-}
-===DONE===
diff --git a/ext/dba/tests/dba_flatfile.phpt b/ext/dba/tests/dba_flatfile.phpt
deleted file mode 100644
index 2e32b8a327..0000000000
--- a/ext/dba/tests/dba_flatfile.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-DBA FlatFile handler test
---SKIPIF--
-<?php
- $handler = 'flatfile';
- require_once('skipif.inc');
-?>
---FILE--
-<?php
- $handler = 'flatfile';
- require_once('test.inc');
- require_once('dba_handler.inc');
-?>
-===DONE===
---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-LOCK--
-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"
-}
-===DONE===
diff --git a/ext/dba/tests/dba_gdbm.phpt b/ext/dba/tests/dba_gdbm.phpt
deleted file mode 100644
index f9b3e3c606..0000000000
--- a/ext/dba/tests/dba_gdbm.phpt
+++ /dev/null
@@ -1,34 +0,0 @@
---TEST--
-DBA GDBM handler test
---SKIPIF--
-<?php
- $handler = 'gdbm';
- require_once('skipif.inc');
-?>
---FILE--
-<?php
- $handler = 'gdbm';
- require_once('test.inc');
- $lock_flag = ''; // lock in library
- require_once('dba_handler.inc');
-
- // Read during write is system dependant. Important is that there is no deadlock
-?>
-===DONE===
---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"
-}
-===DONE===
diff --git a/ext/dba/tests/dba_handler.inc b/ext/dba/tests/dba_handler.inc
deleted file mode 100644
index 9a25316f27..0000000000
--- a/ext/dba/tests/dba_handler.inc
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-
-echo "database handler: $handler\n";
-
-do {
- 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, 'c'.$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) {
- }
-
- if ($lock_flag == '') {
- break;
- } else {
- echo "--NO-LOCK--\n";
- $lock_flag = '';
- }
-} while(1);
-
-?> \ 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 9511a8bb49..0000000000
--- a/ext/dba/tests/dba_inifile.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-DBA INIFILE handler test
---SKIPIF--
-<?php
- $handler = 'inifile';
- require_once('skipif.inc');
-?>
---FILE--
-<?php
- $handler = 'inifile';
- require_once('test.inc');
- require_once('dba_handler.inc');
-?>
-===DONE===
---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-LOCK--
-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"
-}
-===DONE===
diff --git a/ext/dba/tests/dba_ndbm.phpt b/ext/dba/tests/dba_ndbm.phpt
deleted file mode 100644
index f7955c5813..0000000000
--- a/ext/dba/tests/dba_ndbm.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-DBA NDBM handler test
---SKIPIF--
-<?php
- $handler = 'ndbm';
- require_once('skipif.inc');
-?>
---FILE--
-<?php
- $handler = 'ndbm';
- require_once('test.inc');
- require_once('dba_handler.inc');
-?>
-===DONE===
---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-LOCK--
-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"
-}
-===DONE===
diff --git a/ext/dba/tests/dba_qdbm.phpt b/ext/dba/tests/dba_qdbm.phpt
deleted file mode 100755
index a7c9ab69e1..0000000000
--- a/ext/dba/tests/dba_qdbm.phpt
+++ /dev/null
@@ -1,34 +0,0 @@
---TEST--
-DBA QDBM handler test
---SKIPIF--
-<?php
- $handler = 'qdbm';
- require_once('skipif.inc');
-?>
---FILE--
-<?php
- $handler = 'qdbm';
- require_once('test.inc');
- $lock_flag = ''; // lock in library
- require_once('dba_handler.inc');
-?>
-===DONE===
---EXPECTF--
-database handler: qdbm
-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"
-}
-
-Warning: dba_popen(%stest0.dbm,r-): Locking cannot be disabled for handler qdbm in %sdba_handler.inc on line %d
-===DONE===
diff --git a/ext/dba/tests/skipif.inc b/ext/dba/tests/skipif.inc
deleted file mode 100644
index e75000fafd..0000000000
--- a/ext/dba/tests/skipif.inc
+++ /dev/null
@@ -1,23 +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');
- if (!isset($handler)) {
- $handlers = dba_handlers();
- if (in_array('flatfile', $handlers)) {
- $handler = 'flatfile';
- } else {
- $handlers = array_diff($handlers, array('cdb', 'cdb_make')); /* these can only read OR write */
- if (count($handlers)==0) {
- die('skip no handler available that can be used for the test');
- }
- $handler = array_shift($handlers);
- }
- } else {
- 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.cdb b/ext/dba/tests/test.cdb
deleted file mode 100644
index 21529c6280..0000000000
--- a/ext/dba/tests/test.cdb
+++ /dev/null
Binary files differ
diff --git a/ext/dba/tests/test.inc b/ext/dba/tests/test.inc
deleted file mode 100644
index 04f954541c..0000000000
--- a/ext/dba/tests/test.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
- require_once('skipif.inc');
- $lock_flag = 'l';
- $db_filename = $db_file = dirname(__FILE__).'/test0.dbm';
- @unlink($db_filename);
- @unlink($db_filename.'.lck');
-?>