projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- allow requests for compressed content even if neither curl nor ext/http
[m6w6/ext-http]
/
tests
/
negotiation_001.phpt
diff --git
a/tests/negotiation_001.phpt
b/tests/negotiation_001.phpt
index 88e6ec45b164986e3cd5e38fee515150fbaefdb3..d4b13ac0ccc416d7def7c71df2830bd588a5e273 100644
(file)
--- a/
tests/negotiation_001.phpt
+++ b/
tests/negotiation_001.phpt
@@
-5,6
+5,7
@@
negotiation
include 'skip.inc';
?>
--ENV--
include 'skip.inc';
?>
--ENV--
+HTTP_ACCEPT=application/xml, application/xhtml+xml, text/html ; q = .8
HTTP_ACCEPT_LANGUAGE=de-AT,de-DE;q=0.8,en-GB;q=0.3,en-US;q=0.2
HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7
--FILE--
HTTP_ACCEPT_LANGUAGE=de-AT,de-DE;q=0.8,en-GB;q=0.3,en-US;q=0.2
HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7
--FILE--
@@
-16,23
+17,40
@@
$langs = array(
$csets = array(
array('utf-8', 'iso-8859-1'),
);
$csets = array(
array('utf-8', 'iso-8859-1'),
);
+$ctype = array(
+ array('foo/bar', 'application/xhtml+xml', 'text/html')
+);
var_dump(http_negotiate_language($langs[0]));
var_dump(http_negotiate_language($langs[0]));
-
print_r(http_negotiate_language($langs[0], true
));
+
var_dump(http_negotiate_language($langs[0], $lresult
));
var_dump(http_negotiate_charset($csets[0]));
var_dump(http_negotiate_charset($csets[0]));
-print_r(http_negotiate_charset($csets[0], true));
+var_dump(http_negotiate_charset($csets[0], $cresult));
+var_dump(http_negotiate_content_type($ctype[0]));
+var_dump(http_negotiate_content_type($ctype[0], $tresult));
+print_r($lresult);
+print_r($cresult);
+print_r($tresult);
echo "Done\n";
--EXPECTF--
%sTEST
string(2) "de"
echo "Done\n";
--EXPECTF--
%sTEST
string(2) "de"
+string(2) "de"
+string(10) "iso-8859-1"
+string(10) "iso-8859-1"
+string(21) "application/xhtml+xml"
+string(21) "application/xhtml+xml"
Array
(
Array
(
- [de] =>
5
00
- [en] => 0.
15
+ [de] =>
9
00
+ [en] => 0.
27
)
)
-string(10) "iso-8859-1"
Array
(
[iso-8859-1] => 1000
[utf-8] => 0.7
)
Array
(
[iso-8859-1] => 1000
[utf-8] => 0.7
)
+Array
+(
+ [application/xhtml+xml] => 999
+ [text/html] => 0.8
+)
Done
Done