xref: /PHP-8.0/ext/dba/tests/dba_db4_017.phpt (revision 26dfce7f)
1--TEST--
2DBA DB4 file creation dba_open("cd")
3--SKIPIF--
4<?php
5$handler = "db4";
6require_once(__DIR__ .'/skipif.inc');
7?>
8--FILE--
9<?php
10
11$handler = "db4";
12require_once(__DIR__ .'/test.inc');
13echo "database handler: $handler\n";
14
15if (($db_file = dba_open($db_filename, "cd", $handler)) !== FALSE) {
16    if (file_exists($db_filename)) {
17        echo "database file created\n";
18        var_dump(dba_insert("key1", "This is a test insert", $db_file));
19        echo dba_fetch("key1", $db_file), "\n";
20        dba_close($db_file);
21    } else {
22        echo "File did not get created\n";
23    }
24} else {
25    echo "Error creating $db_filename\n";
26}
27
28?>
29--CLEAN--
30<?php
31require(__DIR__ .'/clean.inc');
32?>
33--EXPECT--
34database handler: db4
35database file created
36bool(true)
37This is a test insert
38