PATH:
opt
/
alt
/
tests
/
alt-php74-pecl-http_3.3.0-1.el8
/
tests
--TEST-- negotiate --SKIPIF-- <?php include "skipif.inc"; ?> --ENV-- HTTP_ACCEPT=text/html,text/plain,text/xml;q=0.1,image/*;q=0.1,*/*;q=0 HTTP_ACCEPT_CHARSET=utf-8,iso-8859-1;q=0.8,iso-8859-15;q=0 HTTP_ACCEPT_ENCODING=gzip,deflate;q=0 HTTP_ACCEPT_LANGUAGE=de-DE,de-AT;q=0.9,en;q=0.8,fr;q=0 --FILE-- CONTENT TYPE <?php function dump($ctr) { print_r(array_map(function($v){return round($v,2);}, $ctr)); } $ct = http\Env::negotiateContentType(array("text/html","text/xml","text/json"), $ctr); echo "$ct: "; dump($ctr); $ct = http\Env::negotiateContentType(array("text/xml","text/json"), $ctr); echo "$ct: "; dump($ctr); $ct = http\Env::negotiateContentType(array("text/json"), $ctr); echo "$ct: "; dump($ctr); ?> CHARSET <?php $cs = http\Env::negotiateCharset(array("utf-8", "iso-8859-1", "iso-8859-15"), $csr); echo "$cs: "; dump($csr); $cs = http\Env::negotiateCharset(array("iso-8859-1", "iso-8859-15"), $csr); echo "$cs: "; dump($csr); $cs = http\Env::negotiateCharset(array("utf-16", "iso-8859-15", "iso-8859-2"), $csr); echo "$cs: "; dump($csr); ?> ENCODING <?php $ce = http\Env::negotiateEncoding(array("gzip", "deflate", "sdch"), $cer); echo "$ce: "; dump($cer); $ce = http\Env::negotiateEncoding(array("", "sdch"), $cer); echo "$ce: "; dump($cer); ?> LANGUAGE <?php $ln = http\Env::negotiateLanguage(array("de", "en", "fr"), $lnr); echo "$ln: "; dump($lnr); $ln = http\Env::negotiateLanguage(array("de-DE", "de-AT", "en"), $lnr); echo "$ln: "; dump($lnr); $ln = http\Env::negotiateLanguage(array("nl", "fr", "en"), $lnr); echo "$ln: "; dump($lnr); ?> CUSTOM <?php $cc = http\Env::negotiate("a, a.b;q=0.9, c.d;q=0, *.* ; q=0.1", array("a.x", "c.d", "c.e", "a.b"), ".", $ccr); echo "$cc: "; dump($ccr); ?> DONE --EXPECT-- CONTENT TYPE text/html: Array ( [text/html] => 0.99 [text/xml] => 0.1 ) text/xml: Array ( [text/xml] => 0.1 ) text/json: Array ( ) CHARSET utf-8: Array ( [utf-8] => 0.99 [iso-8859-1] => 0.8 ) iso-8859-1: Array ( [iso-8859-1] => 0.8 ) utf-16: Array ( ) ENCODING gzip: Array ( [gzip] => 0.99 ) : Array ( ) LANGUAGE de: Array ( [de] => 0.97 [en] => 0.8 ) de-DE: Array ( [de-DE] => 0.99 [de-AT] => 0.9 [en] => 0.8 ) en: Array ( [en] => 0.8 ) CUSTOM a.b: Array ( [a.b] => 0.9 [a.x] => 0.08 [c.e] => 0.08 ) DONE
[+]
..
[-] message003.phpt
[edit]
[-] encstream005.phpt
[edit]
[-] client008.phpt
[edit]
[-] header009.phpt
[edit]
[-] encstream004.phpt
[edit]
[-] message011.phpt
[edit]
[-] headerparser003.phpt
[edit]
[-] client019.phpt
[edit]
[-] envresponse002.phpt
[edit]
[-] encstream006.phpt
[edit]
[-] urlparser012.phpt
[edit]
[-] client014.phpt
[edit]
[-] etag001.phpt
[edit]
[-] encstream017.phpt
[edit]
[-] urlparser011.phpt
[edit]
[-] encstream007.phpt
[edit]
[-] urlparser010.phpt
[edit]
[-] urlparser006.phpt
[edit]
[-] bug69076.phpt
[edit]
[-] client010.phpt
[edit]
[-] headerparser002.phpt
[edit]
[-] bug69000.phpt
[edit]
[-] filterchunked.phpt
[edit]
[-] messagebody008.phpt
[edit]
[-] cookie011.phpt
[edit]
[-] encstream002.phpt
[edit]
[-] client003.phpt
[edit]
[+]
data
[-] messagebody010.phpt
[edit]
[-] message009.phpt
[edit]
[-] client012.phpt
[edit]
[-] messagebody004.phpt
[edit]
[+]
helper
[-] messagebody001.phpt
[edit]
[-] message006.phpt
[edit]
[-] envreset001.phpt
[edit]
[-] encstream018.phpt
[edit]
[-] client009.phpt
[edit]
[-] envrequestbody001.phpt
[edit]
[-] header007.phpt
[edit]
[-] clientresponse003.phpt
[edit]
[-] cookie009.phpt
[edit]
[-] cookie010.phpt
[edit]
[-] info001.phpt
[edit]
[-] phpinfo.phpt
[edit]
[-] params013.phpt
[edit]
[-] envresponsebody001.phpt
[edit]
[-] propertyproxy001.phpt
[edit]
[-] messagebody009.phpt
[edit]
[-] filterzlib.phpt
[edit]
[-] bug61444.phpt
[edit]
[-] urlparser007.phpt
[edit]
[-] header004.phpt
[edit]
[-] client015.phpt
[edit]
[-] params012.phpt
[edit]
[-] message001.phpt
[edit]
[-] encstream019.phpt
[edit]
[-] querystring003.phpt
[edit]
[-] client024.phpt
[edit]
[-] params005.phpt
[edit]
[-] serialize001.phpt
[edit]
[-] cookie008.phpt
[edit]
[-] gh-issue6.phpt
[edit]
[-] clientrequest004.phpt
[edit]
[-] client032.phpt
[edit]
[-] encstream001.phpt
[edit]
[-] urlparser004.phpt
[edit]
[-] params014.phpt
[edit]
[-] cookie003.phpt
[edit]
[-] url003.phpt
[edit]
[-] cookie012.phpt
[edit]
[-] info002.phpt
[edit]
[-] cookie006.phpt
[edit]
[-] encstream008.phpt
[edit]
[-] envresponse004.phpt
[edit]
[-] envresponseheader001.phpt
[edit]
[-] envrequestfiles002.phpt
[edit]
[-] messagebody005.phpt
[edit]
[-] messagebody006.phpt
[edit]
[-] url004.phpt
[edit]
[-] client029.phpt
[edit]
[-] client026.phpt
[edit]
[-] bug71719.phpt
[edit]
[-] bug67932.phpt
[edit]
[-] header008.phpt
[edit]
[-] client031.phpt
[edit]
[-] encstream016.phpt
[edit]
[-] urlparser005.phpt
[edit]
[-] client028.phpt
[edit]
[-] params010.phpt
[edit]
[-] params002.phpt
[edit]
[-] client023.phpt
[edit]
[-] header003.phpt
[edit]
[-] encstream015.phpt
[edit]
[-] params008.phpt
[edit]
[-] clientrequest001.phpt
[edit]
[-] client005.phpt
[edit]
[-] message015.phpt
[edit]
[-] gh-issue92.phpt
[edit]
[-] urlparser001.phpt
[edit]
[-] client020.phpt
[edit]
[-] bug69357.phpt
[edit]
[-] header002.phpt
[edit]
[-] urlparser008.phpt
[edit]
[-] message007.phpt
[edit]
[-] bug69313.phpt
[edit]
[-] envrequestcookie001.phpt
[edit]
[-] cookie004.phpt
[edit]
[-] urlparser013.phpt
[edit]
[-] url001.phpt
[edit]
[-] message012.phpt
[edit]
[-] negotiate001.phpt
[edit]
[-] clientresponse002.phpt
[edit]
[-] cookie002.phpt
[edit]
[-] envresponsebody002.phpt
[edit]
[-] envresponse018.phpt
[edit]
[-] cookie005.phpt
[edit]
[-] bug66388.phpt
[edit]
[-] header006.phpt
[edit]
[-] querystring001.phpt
[edit]
[-] message005.phpt
[edit]
[-] clientrequest002.phpt
[edit]
[-] message002.phpt
[edit]
[-] client030.phpt
[edit]
[-] message013.phpt
[edit]
[-] cookie007.phpt
[edit]
[-] params011.phpt
[edit]
[-] gh-issue42.phpt
[edit]
[-] envresponsecodes.phpt
[edit]
[-] params004.phpt
[edit]
[-] envresponse017.phpt
[edit]
[-] client016.phpt
[edit]
[-] params015.phpt
[edit]
[-] client013.phpt
[edit]
[-] client001.phpt
[edit]
[-] client006.phpt
[edit]
[-] urlparser009.phpt
[edit]
[-] client004.phpt
[edit]
[-] header005.phpt
[edit]
[-] bug73055.phpt
[edit]
[-] envresponse016.phpt
[edit]
[-] params001.phpt
[edit]
[-] gh-issue50.phpt
[edit]
[-] params009.phpt
[edit]
[-] message016.phpt
[edit]
[-] cookie001.phpt
[edit]
[-] encstream009.phpt
[edit]
[-] messagebody002.phpt
[edit]
[-] envresponseranges001.phpt
[edit]
[-] params003.phpt
[edit]
[-] client011.phpt
[edit]
[-] client025.phpt
[edit]
[-] urlparser003.phpt
[edit]
[-] clientrequest003.phpt
[edit]
[-] envresponsecookie001.phpt
[edit]
[-] gh-issue63.phpt
[edit]
[-] filterbrotli.phpt
[edit]
[-] querystring001_a.phpt
[edit]
[-] envrequestquery.phpt
[edit]
[-] envrequestfiles001.phpt
[edit]
[-] message010.phpt
[edit]
[-] client007.phpt
[edit]
[-] envresponse015.phpt
[edit]
[-] messageparser002.phpt
[edit]
[-] client018.phpt
[edit]
[-] headerparser001.phpt
[edit]
[-] params007.phpt
[edit]
[-] client022.phpt
[edit]
[-] version001.phpt
[edit]
[-] messagebody003.phpt
[edit]
[-] params017.phpt
[edit]
[-] messagebody007.phpt
[edit]
[-] params016.phpt
[edit]
[-] urlparser002.phpt
[edit]
[-] params006.phpt
[edit]
[-] envresponse003.phpt
[edit]
[-] envrequestform.phpt
[edit]
[-] encstream003.phpt
[edit]
[-] message004.phpt
[edit]
[-] client017.phpt
[edit]
[-] gh-issue11.phpt
[edit]
[-] client002.phpt
[edit]
[-] url002.phpt
[edit]
[-] client027.phpt
[edit]
[-] client021.phpt
[edit]
[-] header001.phpt
[edit]
[-] querystring002.phpt
[edit]
[-] skipif.inc
[edit]
[-] message008.phpt
[edit]
[-] clientresponse001.phpt
[edit]
[-] messageparser001.phpt
[edit]
[-] bug66891.phpt
[edit]
[-] envrequestheader001.phpt
[edit]
[-] url005.phpt
[edit]
[-] message014.phpt
[edit]