xref: /PHP-8.1/ext/dba/tests/dba_db4_009.phpt (revision b5a14e6c)
1--TEST--
2DBA DB4 Multiple File Creation Test
3--EXTENSIONS--
4dba
5--SKIPIF--
6<?php
7$handler = "db4";
8require_once(__DIR__ .'/skipif.inc');
9die("info $HND handler used");
10?>
11--FILE--
12<?php
13$handler = "db4";
14require_once(__DIR__ .'/test.inc');
15echo "database handler: $handler\n";
16$db_file1 = $db_filename1 = __DIR__.'/test1.dbm';
17$db_file2 = $db_filename2 = __DIR__.'/test2.dbm';
18if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
19    echo "database file created\n";
20} else {
21    echo "$db_file does not exist\n";
22}
23if (($db_file1=dba_open($db_file1, "n", $handler))!==FALSE) {
24    echo "database file created\n";
25} else {
26    echo "$db_file does not exist\n";
27}
28if (($db_file2=dba_open($db_file2, "n", $handler))!==FALSE) {
29    echo "database file created\n";
30} else {
31    echo "$db_file does not exist\n";
32}
33var_dump(dba_list());
34dba_close($db_file);
35
36@unlink($db_filename1);
37@unlink($db_filename2);
38?>
39--CLEAN--
40<?php
41require(__DIR__ .'/clean.inc');
42?>
43--EXPECTF--
44database handler: db4
45database file created
46database file created
47database file created
48array(3) {
49  [%d]=>
50  string(%d) "%stest0.dbm"
51  [%d]=>
52  string(%d) "%stest1.dbm"
53  [%d]=>
54  string(%d) "%stest2.dbm"
55}
56