xref: /PHP-8.1/ext/dba/tests/dba003.phpt (revision b5a14e6c)
1--TEST--
2DBA Insert/Replace/Fetch Test
3--EXTENSIONS--
4dba
5--SKIPIF--
6<?php
7    require_once(__DIR__ .'/skipif.inc');
8    die("info $HND handler used");
9?>
10--FILE--
11<?php
12    require_once(__DIR__ .'/test.inc');
13    echo "database handler: $handler\n";
14    if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
15        dba_insert("key1", "This is a test insert", $db_file);
16        dba_replace("key1", "This is the replacement text", $db_file);
17        $a = dba_fetch("key1", $db_file);
18        dba_close($db_file);
19        echo $a;
20    } else {
21        echo "Error creating database\n";
22    }
23?>
24--CLEAN--
25<?php
26    require(__DIR__ .'/clean.inc');
27?>
28--EXPECTF--
29database handler: %s
30This is the replacement text
31