]> granicus.if.org Git - php/commitdiff
Merge branch 'pull-request/1816'
authorJoe Watkins <krakjoe@php.net>
Mon, 17 Oct 2016 15:50:12 +0000 (16:50 +0100)
committerJoe Watkins <krakjoe@php.net>
Mon, 17 Oct 2016 16:01:28 +0000 (17:01 +0100)
ext/hash/tests/hash_update_stream.phpt [new file with mode: 0644]

diff --git a/ext/hash/tests/hash_update_stream.phpt b/ext/hash/tests/hash_update_stream.phpt
new file mode 100644 (file)
index 0000000..b628b9c
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+int hash_update_stream ( resource $context , resource $handle [, int $length = -1 ] );
+--CREDITS--
+marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
+--SKIPIF--
+<?php
+if (phpversion() < "5.3.0") {
+    die('SKIP php version so lower.');
+}
+require_once(dirname(__FILE__) . '/skip_mhash.inc'); ?>
+?>
+--FILE--
+<?php
+$fp = tmpfile();
+fwrite($fp, 'The quick brown fox jumped over the lazy dog.');
+rewind($fp);
+
+$ctx = hash_init('md5');
+hash_update_stream($ctx, $fp);
+echo hash_final($ctx);
+?>
+--EXPECT--
+5c6ffbdd40d9556b73a21e63c3e0e904