php-src/ext/dba/tests/bug72885.phpt
Anatol Belski 36b5ab15f4 Fixed bug #72885 flatfile: dba_fetch() fails to read replaced entry
With append mode it is only possible to write to the end of the file. It
is not suitable for drivers like flatfile. Thus, if the file is created,
the stream is closed and is reopened with r+b, otherwise r+ mode is used
right away.
2017-05-27 22:23:02 +02:00

29 lines
525 B
PHP

--TEST--
Bug #72885 flatfile: dba_fetch() fails to read replaced entry
--SKIPIF--
<?php
$handler = "flatfile";
require_once(dirname(__FILE__) .'/skipif.inc');
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
$db = dba_open($db_filename, 'c', 'flatfile');
dba_insert('foo', 'bar', $db);
var_dump(dba_replace('foo', 'baz', $db));
var_dump(dba_fetch('foo', $db));
dba_close($db);
?>
===DONE===
--CLEAN--
<?php
require_once(dirname(__FILE__) .'/clean.inc');
?>
--EXPECT--
bool(true)
string(3) "baz"
===DONE===