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