xref: /PHP-8.1/ext/dba/tests/dba_db4_optimize.phpt (revision b5a14e6c)
1--TEST--
2DBA DB4 Optimize Test
3--EXTENSIONS--
4dba
5--SKIPIF--
6<?php
7$handler = "db4";
8require_once(__DIR__ .'/skipif.inc');
9die("info $HND handler used");
10?>
11--FILE--
12<?php
13$handler = "db4";
14require_once(__DIR__ .'/test.inc');
15echo "database handler: $handler\n";
16if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
17    dba_insert("key1", "Content String 1", $db_file);
18    dba_insert("key2", "Content String 2", $db_file);
19    for ($i=1; $i<3; $i++) {
20        echo dba_exists("key$i", $db_file) ? "Y" : "N";
21    }
22    echo "\n";
23    var_dump(dba_optimize($db_file));
24    dba_close($db_file);
25} else {
26    echo "Error creating database\n";
27}
28
29?>
30--CLEAN--
31<?php
32require(__DIR__ .'/clean.inc');
33?>
34--EXPECT--
35database handler: db4
36YY
37bool(true)
38