summaryrefslogtreecommitdiff
path: root/ext/hash
diff options
context:
space:
mode:
authormarcosptf <marcosptf@yahoo.com.br>2016-03-13 12:46:48 -0300
committermarcosptf <marcosptf@yahoo.com.br>2016-03-13 12:46:48 -0300
commit1b683c34ae1b8d7277420ac5398a3a474453ef1e (patch)
tree1f13abc6ae703ae1a8339adcd71a5c0ec85b0b02 /ext/hash
parent01579ae0a6eda82b72a8d44d5cbdeef50a21ca79 (diff)
downloadphp-git-1b683c34ae1b8d7277420ac5398a3a474453ef1e.tar.gz
test to function hash_update_stream();
was added a new function to module hash
Diffstat (limited to 'ext/hash')
-rw-r--r--ext/hash/tests/hash_update_stream.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/hash/tests/hash_update_stream.phpt b/ext/hash/tests/hash_update_stream.phpt
new file mode 100644
index 0000000000..cb2e7f4645
--- /dev/null
+++ b/ext/hash/tests/hash_update_stream.phpt
@@ -0,0 +1,22 @@
+--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.');
+}
+?>
+--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