summaryrefslogtreecommitdiff
path: root/ext/bz2
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2011-06-05 21:57:01 +0000
committerIlia Alshanetsky <iliaa@php.net>2011-06-05 21:57:01 +0000
commitd846d0e80aa0822ab3f59eea9e85413c4d357748 (patch)
treee91ac9752f932ae2476cf9889b89f97ec165c03a /ext/bz2
parent10da251565e80d9030a6c9609e91fda8c7197ef5 (diff)
downloadphp-git-d846d0e80aa0822ab3f59eea9e85413c4d357748.tar.gz
Fixed bug #51997 (SEEK_CUR with 0 value, returns a warning).
Diffstat (limited to 'ext/bz2')
-rw-r--r--ext/bz2/tests/bug51997.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/bz2/tests/bug51997.phpt b/ext/bz2/tests/bug51997.phpt
new file mode 100644
index 0000000000..fea5398947
--- /dev/null
+++ b/ext/bz2/tests/bug51997.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #51997 (SEEK_CUR with 0 value, returns a warning)
+--SKIPIF--
+<?php if (!extension_loaded("bz2")) print "skip"; ?>
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+$filename = "testfile.bz2";
+$str = "This is a test string.\n";
+$bz = bzopen($filename, "w");
+bzwrite($bz, $str);
+bzclose($bz);
+
+$bz = bzopen($filename, "r");
+fseek($bz, 0, SEEK_CUR);
+print bzread($bz, 10);
+print bzread($bz);
+bzclose($bz);
+unlink($filename);
+
+--EXPECT--
+This is a test string.