xref: /PHP-8.0/ext/dba/tests/bug62490.phpt (revision f8d79582)
1--TEST--
2Bug #62490 (dba_delete returns true on missing item (inifile))
3--SKIPIF--
4<?php
5$handler = "inifile";
6include "skipif.inc";
7?>
8--FILE--
9<?php
10$handler = "inifile";
11include "test.inc";
12
13$dba = dba_open($db_filename, "n", $handler)
14    or die;
15for ($i = 0; $i < 3; ++$i) {
16    echo "insert $i:";
17    var_dump(dba_insert("a", $i, $dba));
18}
19
20echo "exists:";
21var_dump(dba_exists("a", $dba));
22echo "delete:";
23var_dump(dba_delete("a", $dba));
24echo "exists:";
25var_dump(dba_exists("a", $dba));
26echo "delete:";
27var_dump(dba_delete("a", $dba));
28
29?>
30--CLEAN--
31<?php
32include "clean.inc";
33?>
34--EXPECT--
35insert 0:bool(true)
36insert 1:bool(true)
37insert 2:bool(true)
38exists:bool(true)
39delete:bool(true)
40exists:bool(false)
41delete:bool(false)
42