JezK
Edit File: 006.phpt
--TEST-- Test function rsync_generate_delta with stream as input and output. --SKIPIF-- <?php if (!extension_loaded("rsync")) print "skip"; ?> --FILE-- <?php $targetMD5 = 'b6efe00f2049d221626e63c2a2534361'; $sig = fopen(dirname(__FILE__) . '/006signatur.sig', 'rb'); $file = fopen(dirname(__FILE__) . '/006test.png', 'rb'); $patch = fopen(dirname(__FILE__) . '/006test.patch', 'wb'); $ret = rsync_generate_delta($sig, $file, $patch); fclose($sig); fclose($file); fclose($patch); $resultMD5 = md5_file(dirname(__FILE__) . '/006test.patch'); if ($resultMD5 == $targetMD5 && $ret == RSYNC_DONE) { echo "SUCCESS\n"; } else { echo "FAILED with Return $ret and MD5 $resultMD5\n"; } unlink(dirname(__FILE__) . '/006test.patch'); ?> --EXPECT-- SUCCESS