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