xref: /PHP-8.1/ext/dba/tests/dba_db4_005.phpt (revision b5a14e6c)
1--TEST--
2DBA DB4 New File Creation popen("c") & Insert 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
14$handler = "db4";
15require_once(__DIR__ .'/test.inc');
16echo "database handler: $handler\n";
17if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
18    echo "database file created\n";
19    dba_insert("key1", "This is a test insert", $db_file);
20    echo dba_fetch("key1", $db_file), "\n";
21    dba_close($db_file);
22} else {
23    echo "Error creating $db_filename\n";
24}
25
26?>
27--CLEAN--
28<?php
29require(__DIR__ .'/clean.inc');
30?>
31--EXPECT--
32database handler: db4
33database file created
34This is a test insert
35