xref: /PHP-8.3/ext/dba/tests/dba_array_keys.phpt (revision eddab740)
1--TEST--
2DBA check behaviour of array keys
3--EXTENSIONS--
4dba
5--SKIPIF--
6<?php
7require_once __DIR__ . '/setup/setup_dba_tests.inc';
8check_skip_any();
9?>
10--FILE--
11<?php
12require_once __DIR__ . '/setup/setup_dba_tests.inc';
13$name = 'array_keys_basic.db';
14
15$db = get_any_db($name);
16
17var_dump(dba_insert(['group', 'name'], 'Normal group', $db));
18var_dump(dba_insert(['group', ''], 'Empty name', $db));
19var_dump(dba_insert(['', 'name'], 'Empty group', $db));
20var_dump(dba_insert(['', ''], 'Empty keys', $db));
21var_dump(dba_fetch(['group', 'name'], $db));
22var_dump(dba_fetch(['group', ''], $db));
23var_dump(dba_fetch(['', 'name'], $db));
24var_dump(dba_fetch(['', ''], $db));
25dba_close($db);
26
27?>
28--CLEAN--
29<?php
30require_once __DIR__ . '/setup/setup_dba_tests.inc';
31$db_name = 'array_keys_basic.db';
32cleanup_standard_db($db_name);
33?>
34--EXPECTF--
35Using handler: "%s"
36bool(true)
37bool(true)
38bool(true)
39bool(true)
40string(12) "Normal group"
41string(10) "Empty name"
42string(11) "Empty group"
43string(10) "Empty keys"
44