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