diff options
| author | Marcus Boerger <helly@php.net> | 2002-11-03 15:11:42 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2002-11-03 15:11:42 +0000 |
| commit | a54cf8b94a966abbb2354adab108dd97ca74f511 (patch) | |
| tree | 623cf17bcb855d84e57d4a2405a41cfecf547765 /ext/dba/tests | |
| parent | 6668f61ecb7a934987559800dae9907005d0ec6c (diff) | |
| download | php-git-a54cf8b94a966abbb2354adab108dd97ca74f511.tar.gz | |
cdb interface is currently readonly
Diffstat (limited to 'ext/dba/tests')
| -rw-r--r-- | ext/dba/tests/dba_cdb_read.phpt | 41 | ||||
| -rw-r--r-- | ext/dba/tests/test.cdb | bin | 0 -> 2230 bytes |
2 files changed, 41 insertions, 0 deletions
diff --git a/ext/dba/tests/dba_cdb_read.phpt b/ext/dba/tests/dba_cdb_read.phpt new file mode 100644 index 0000000000..8598d19d2e --- /dev/null +++ b/ext/dba/tests/dba_cdb_read.phpt @@ -0,0 +1,41 @@ +--TEST-- +DBA CDB handler test (read only) +--SKIPIF-- +<?php + require_once('skipif.inc'); + 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) { + $a = dba_firstkey($db_file); + $i=0; + echo "?$a"; + while($a) { + $a = dba_nextkey($db_file); + echo $a; + $i++; + } + echo "\n"; + echo $i; + for ($i=1; $i<5; $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); + dba_close($db_file); + } else { + echo "Error creating database\n"; + } +?> +--EXPECT-- +database handler: cdb +?1212314 +7YYYY +=1234
\ No newline at end of file diff --git a/ext/dba/tests/test.cdb b/ext/dba/tests/test.cdb Binary files differnew file mode 100644 index 0000000000..21529c6280 --- /dev/null +++ b/ext/dba/tests/test.cdb |
