xref: /PHP-7.3/ext/dba/tests/dba_db4_015.phpt (revision 782352c5)
1--TEST--
2DBA DB4 File open("wl") & Insert Test
3--SKIPIF--
4<?php
5$handler = "db4";
6require_once(dirname(__FILE__) .'/skipif.inc');
7die("info $HND handler used");
8?>
9--FILE--
10<?php
11
12$handler = "db4";
13require_once(dirname(__FILE__) .'/test.inc');
14echo "database handler: $handler\n";
15
16if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
17    echo "database file created\n";
18    dba_close($db_file);
19}
20
21if (($db_file = dba_popen($db_filename, "wl", $handler)) !== FALSE) {
22    echo "database file opened\n";
23    dba_insert("key1", "This is a test insert", $db_file);
24    echo dba_fetch("key1", $db_file), "\n";
25    dba_close($db_file);
26} else {
27    echo "Error creating $db_filename\n";
28}
29
30?>
31--CLEAN--
32<?php
33require(dirname(__FILE__) .'/clean.inc');
34?>
35--EXPECT--
36database handler: db4
37database file created
38database file opened
39This is a test insert
40