xref: /PHP-7.3/ext/dba/tests/bug62490.phpt (revision 782352c5)
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===DONE===
31--CLEAN--
32<?php
33include "clean.inc";
34?>
35--EXPECT--
36insert 0:bool(true)
37insert 1:bool(true)
38insert 2:bool(true)
39exists:bool(true)
40delete:bool(true)
41exists:bool(false)
42delete:bool(false)
43===DONE===
44