Annotation of embedaddon/php/ext/dba/tests/dba_db4_003.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: DBA DB4 File Creation open("c") with existing file
3: --SKIPIF--
4: <?php
5: $handler = "db4";
6: require_once(dirname(__FILE__) .'/skipif.inc');
7: die("info $HND handler used");
8: ?>
9: --FILE--
10: <?php
11:
12: $handler = "db4";
13: require_once(dirname(__FILE__) .'/test.inc');
14: echo "database handler: $handler\n";
15:
16: var_dump(file_put_contents($db_filename, "Dummy contents"));
17:
18: if (($db_file = dba_open($db_filename, "c", $handler)) !== FALSE) {
19: if (file_exists($db_filename)) {
20: echo "database file created\n";
21: dba_close($db_file);
22: } else {
23: echo "File did not get created\n";
24: }
25: } else {
26: echo "Error creating $db_filename\n";
27: }
28:
29: // Check the file still exists
30: $s = file_get_contents($db_filename);
31: echo "$s\n";
32:
33: ?>
34: --CLEAN--
35: <?php
36: require(dirname(__FILE__) .'/clean.inc');
37: ?>
38: --EXPECTF--
39: database handler: db4
40: int(14)
41:
42: Notice: dba_open(): %stest0.dbm: unexpected file type or format in %sdba_db4_003.php on line %d
43:
44: Warning: dba_open(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_003.php on line %d
45: Error creating %stest0.dbm
46: Dummy contents
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>