- fix issues ifndef HTTP_HAVE_CURL
[m6w6/ext-http] / tests / etag_mode_crc.phpt
1 --TEST--
2 sane crc etags
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkver(5.1);
7 skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
8 skipif(!defined('HTTP_ETAG_MHASH_CRC32'), 'need CRC32 mhash support');
9 skipif(!defined('HTTP_ETAG_MHASH_CRC32B'), 'need CRC32B mhash support');
10 ?>
11 --FILE--
12 <?php
13 echo "-TEST\n";
14
15 ini_set('http.etag_mode', HTTP_ETAG_CRC32);
16 HttpResponse::setData("abc");
17 $php = HttpResponse::getEtag();
18
19 ini_set('http.etag_mode', HTTP_ETAG_MHASH_CRC32);
20 HttpResponse::setData("abc");
21 $crc = HttpResponse::getEtag();
22
23 ini_set('http.etag_mode', HTTP_ETAG_MHASH_CRC32B);
24 HttpResponse::setData("abc");
25 $equ = HttpResponse::getEtag();
26
27 echo $php,"\n", $equ,"\n", $crc,"\n";
28
29 var_dump($equ === $php);
30 var_dump($equ !== $crc);
31
32 echo "Done\n";
33 --EXPECTF--
34 %sTEST
35 c2412435
36 c2412435
37 73bb8c64
38 bool(true)
39 bool(true)
40 Done