]> granicus.if.org Git - php/commitdiff
- New test
authorFelipe Pena <felipe@php.net>
Thu, 30 Oct 2008 15:50:33 +0000 (15:50 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 30 Oct 2008 15:50:33 +0000 (15:50 +0000)
ext/standard/tests/streams/stream_get_contents_001.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/streams/stream_get_contents_001.phpt b/ext/standard/tests/streams/stream_get_contents_001.phpt
new file mode 100644 (file)
index 0000000..dc7fcb2
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+stream_get_contents() - Testing offset out of range
+--FILE--
+<?php
+
+$tmp = tmpfile();
+
+fwrite($tmp, "12345");
+
+echo stream_get_contents($tmp, 2, 5), "--\n";
+echo stream_get_contents($tmp, 2), "--\n";
+echo stream_get_contents($tmp, 2, 3), "--\n";
+echo stream_get_contents($tmp, 2, -1), "--\n";
+
+@unlink($tmp);
+
+?>
+--EXPECT--
+--
+--
+45--
+--