xref: /PHP-7.0/ext/dba/tests/bug71514.phpt (revision bd8112af)
1--TEST--
2Bug #71514 (Bad dba_replace condition because of wrong API usage)
3--SKIPIF--
4<?php
5if (!extension_loaded('dba')) die('skip dba extension not available');
6if (!in_array('inifile', dba_handlers())) die('skip inifile handler not available');
7?>
8--FILE--
9<?php
10$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug71514.ini';
11
12$db = dba_open($filename, 'c', 'inifile');
13
14dba_insert('foo', 'value1', $db);
15dba_replace('foo', 'value2', $db);
16var_dump(dba_fetch('foo', $db));
17
18dba_close($db);
19?>
20==DONE==
21--EXPECT--
22string(6) "value2"
23==DONE==
24--CLEAN--
25<?php
26$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug71514.ini';
27unlink($filename);
28?>
29