xref: /PHP-8.4/ext/dba/tests/gh16990.phpt (revision 50264b03)
1--TEST--
2GH-16990 (dba_list() is now zero-indexed instead of using resource ids)
3--EXTENSIONS--
4dba
5--CONFLICTS--
6dba
7--SKIPIF--
8<?php
9require_once __DIR__ . '/setup/setup_dba_tests.inc';
10check_skip('flatfile');
11?>
12--FILE--
13<?php
14
15require_once(__DIR__ .'/test.inc');
16
17$foo1 = new stdClass();
18
19$db_filename1 = __DIR__.'/test1.dbm';
20$db1 = dba_open($db_filename1, 'c', 'flatfile');
21if (!$db1) {
22    var_dump("Database file creation failed");
23}
24
25$foo2 = new stdClass();
26
27$db_filename2 = __DIR__.'/test2.dbm';
28$db2 = dba_open($db_filename2, 'c', 'flatfile');
29if (!$db2) {
30    var_dump("Database file creation failed");
31}
32
33var_dump(dba_list());
34?>
35--CLEAN--
36<?php
37@unlink(__DIR__.'/test1.dbm');
38@unlink(__DIR__.'/test2.dbm');
39?>
40--EXPECTF--
41array(2) {
42  [2]=>
43  string(%d) "%s%etest1.dbm"
44  [4]=>
45  string(%d) "%s%etest2.dbm"
46}
47