fix #91: get rid of most of the yearly failing test
[m6w6/ext-http] / tests / etag001.phpt
1 --TEST--
2 etags with hash
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 _ext("hash");
7 ?>
8 --FILE--
9 <?php
10 $body = new http\Message\Body;
11 $body->append("Hello, my old fellow.");
12 foreach (["md5", "sha1", "sha256"] as $algo) {
13 if (strncmp($algo, "sha3-", 5) && strncmp($algo, "sha512/", 7) && strcmp($algo, "crc32c")) {
14 ini_set("http.etag.mode", $algo);
15 printf("%10s: %s\n",
16 $algo,
17 $body->etag()
18 );
19 }
20 }
21 ?>
22 DONE
23 --EXPECT--
24 md5: 6ce3cc8f3861fb7fd0d77739f11cd29c
25 sha1: ad84012eabe27a61762a97138d9d2623f4f1a7a9
26 sha256: ed9ecfe5c76d51179c3c1065916fdb8d94aee05577f187bd763cdc962bba1f42
27 DONE