diff options
author | Joe Watkins <krakjoe@php.net> | 2016-10-17 16:50:12 +0100 |
---|---|---|
committer | Joe Watkins <krakjoe@php.net> | 2016-10-17 17:02:19 +0100 |
commit | 4dfd5f4403be85d467992bf8a6bae4de40d4a06e (patch) | |
tree | f74bcf19c8f6f860711a17707bceac4e9c5f9d4b /ext/hash | |
parent | d6fb5a1f1e690aca9b6a7508281c90414c5fed81 (diff) | |
download | php-git-4dfd5f4403be85d467992bf8a6bae4de40d4a06e.tar.gz |
Merge branch 'pull-request/1816'
Diffstat (limited to 'ext/hash')
-rw-r--r-- | ext/hash/tests/hash_update_stream.phpt | 23 |
1 files changed, 23 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..b628b9c912 --- /dev/null +++ b/ext/hash/tests/hash_update_stream.phpt @@ -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 |