fix test
[m6w6/ext-http] / tests / header005.phpt
1 --TEST--
2 header negotiation
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9
10 echo "Test\n";
11
12 $a = new http\Header("Accept", "text/html, text/plain;q=0.5, */*;q=0");
13 var_dump("text/html" === $a->negotiate(array("text/plain","text/html")));
14 var_dump("text/html" === $a->negotiate(array("text/plain","text/html"), $rs));
15 var_dump(array("text/html"=>0.99, "text/plain"=>0.5) === $rs);
16 var_dump("text/plain" === $a->negotiate(array("foo/bar", "text/plain"), $rs));
17 var_dump(array("text/plain"=>0.5) === $rs);
18 var_dump("foo/bar" === $a->negotiate(array("foo/bar"), $rs));
19 var_dump(array() === $rs);
20
21 ?>
22 Done
23 --EXPECT--
24 Test
25 bool(true)
26 bool(true)
27 bool(true)
28 bool(true)
29 bool(true)
30 bool(true)
31 bool(true)
32 Done