xref: /PHP-8.3/ext/dba/tests/dba009.phpt (revision eddab740)
1--TEST--
2DBA dba_popen Test
3--EXTENSIONS--
4dba
5--SKIPIF--
6<?php
7    require_once(__DIR__ .'/skipif.inc');
8    print("info $HND handler used");
9?>
10--CONFLICTS--
11dba
12--FILE--
13<?php
14    require_once(__DIR__ .'/test.inc');
15    echo "database handler: $handler\n";
16    if (($db=dba_popen($db_file, "n", $handler))!==FALSE) {
17        echo "Opened\n";
18        dba_insert("a", "Inserted", $db);
19        echo dba_fetch("a", $db)."\n";
20        dba_close($db);
21        echo "Closed\n";
22    } else {
23        echo "Error creating database\n";
24    }
25    if (($db=dba_popen($db_file, "n", $handler))!==FALSE) {
26        echo "Opened\n";
27        dba_insert("a", "Inserted", $db);
28        echo dba_fetch("a", $db)."\n";
29    }
30?>
31--CLEAN--
32<?php
33    require(__DIR__ .'/clean.inc');
34?>
35--EXPECTF--
36database handler: %s
37Opened
38Inserted
39Closed
40Opened
41Inserted
42