PATH:
opt
/
alt
/
tests
/
alt-php81-pecl-http_4.2.6-4.el8
/
tests
--TEST-- message --SKIPIF-- <?php include "skipif.inc"; ?> --FILE-- <?php echo "Test\n"; use http\Message as HttpMessage; try { echo new HttpMessage(" gosh\n nosh\n "); } catch (Exception $ignore) { } $m = new HttpMessage(); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_NONE, $m->getHeaders() ); $m = new HttpMessage("GET / HTTP/1.1\r\n"); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_REQUEST, $m->getRequestMethod(), $m->getRequestUrl(), $m->getHeaders() ); $m = new HttpMessage("HTTP/1.1 200 Okidoki\r\n"); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_RESPONSE, $m->getResponseCode(), $m->getResponseStatus(), $m->getHeaders() ); echo "---\n"; $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty.txt")); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_RESPONSE, $m->getResponseCode(), $m->getResponseStatus(), $m->getHeaders() ); echo $m->getParentMessage(); $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty_gzip.txt")); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_RESPONSE, $m->getResponseCode(), $m->getResponseStatus(), $m->getHeaders() ); echo $m->getParentMessage(); $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty_chunked.txt")); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_RESPONSE, $m->getResponseCode(), $m->getResponseStatus(), $m->getHeaders() ); echo $m->getParentMessage(); $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_helloworld_chunked.txt")); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_RESPONSE, $m->getResponseCode(), $m->getResponseStatus(), $m->getHeaders() ); echo $m->getParentMessage(); echo "---\n"; $m = new HttpMessage(fopen(__DIR__."/data/message_rr_empty.txt", "r+b")); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_RESPONSE, $m->getResponseCode(), $m->getResponseStatus(), $m->getHeaders() ); echo $m->getParentMessage(); $m = new HttpMessage(fopen(__DIR__."/data/message_rr_empty_gzip.txt", "r+b")); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_RESPONSE, $m->getResponseCode(), $m->getResponseStatus(), $m->getHeaders() ); echo $m->getParentMessage(); $m = new HttpMessage(fopen(__DIR__."/data/message_rr_empty_chunked.txt", "r+b")); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_RESPONSE, $m->getResponseCode(), $m->getResponseStatus(), $m->getHeaders() ); echo $m->getParentMessage(); $m = new HttpMessage(fopen(__DIR__."/data/message_rr_helloworld_chunked.txt", "r+b")); echo $m; var_dump( $m->getHttpVersion(), $m->getType()==HttpMessage::TYPE_RESPONSE, $m->getResponseCode(), $m->getResponseStatus(), $m->getHeaders() ); echo $m->getParentMessage(); echo "Done\n"; --EXPECTF-- Test string(3) "1.1" bool(true) array(0) { } GET / HTTP/1.1 string(3) "1.1" bool(true) string(3) "GET" string(1) "/" array(0) { } HTTP/1.1 200 Okidoki string(3) "1.1" bool(true) int(200) string(7) "Okidoki" array(0) { } --- HTTP/1.1 200 OK Date: Wed, 25 Aug 2010 12:11:44 GMT Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT Etag: "2002a-0-48549d615a35c" Accept-Ranges: bytes Content-Length: 0 Vary: Accept-Encoding Connection: close Content-Type: text/plain X-Original-Content-Length: 0 string(3) "1.1" bool(true) int(200) string(2) "OK" array(10) { ["Date"]=> string(29) "Wed, 25 Aug 2010 12:11:44 GMT" ["Server"]=> string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6" ["Last-Modified"]=> string(29) "Wed, 28 Apr 2010 10:54:37 GMT" ["Etag"]=> string(23) ""2002a-0-48549d615a35c"" ["Accept-Ranges"]=> string(5) "bytes" ["Content-Length"]=> string(1) "0" ["Vary"]=> string(15) "Accept-Encoding" ["Connection"]=> string(5) "close" ["Content-Type"]=> string(10) "text/plain" ["X-Original-Content-Length"]=> string(1) "0" } GET /default/empty.txt HTTP/1.1 Host: localhost Connection: close HTTP/1.1 200 OK Date: Thu, 26 Aug 2010 09:55:09 GMT Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT Etag: "2002a-0-48549d615a35c" Accept-Ranges: bytes Vary: Accept-Encoding Connection: close Content-Type: text/plain X-Original-Content-Length: 20 X-Original-Content-Encoding: gzip string(3) "1.1" bool(true) int(200) string(2) "OK" array(10) { ["Date"]=> string(29) "Thu, 26 Aug 2010 09:55:09 GMT" ["Server"]=> string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6" ["Last-Modified"]=> string(29) "Wed, 28 Apr 2010 10:54:37 GMT" ["Etag"]=> string(23) ""2002a-0-48549d615a35c"" ["Accept-Ranges"]=> string(5) "bytes" ["Vary"]=> string(15) "Accept-Encoding" ["Connection"]=> string(5) "close" ["Content-Type"]=> string(10) "text/plain" ["X-Original-Content-Length"]=> string(2) "20" ["X-Original-Content-Encoding"]=> string(4) "gzip" } GET /default/empty.txt HTTP/1.1 Host: localhost Accept-Encoding: gzip Connection: close HTTP/1.1 200 OK Date: Thu, 26 Aug 2010 11:41:02 GMT Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6 X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Connection: close Content-Type: text/html X-Original-Transfer-Encoding: chunked Content-Length: 0 string(3) "1.1" bool(true) int(200) string(2) "OK" array(8) { ["Date"]=> string(29) "Thu, 26 Aug 2010 11:41:02 GMT" ["Server"]=> string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6" ["X-Powered-By"]=> string(9) "PHP/5.3.3" ["Vary"]=> string(15) "Accept-Encoding" ["Connection"]=> string(5) "close" ["Content-Type"]=> string(9) "text/html" ["X-Original-Transfer-Encoding"]=> string(7) "chunked" ["Content-Length"]=> int(0) } GET /default/empty.php HTTP/1.1 Connection: close Host: localhost HTTP/1.1 200 OK Date: Thu, 26 Aug 2010 12:51:28 GMT Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6 Vary: Accept-Encoding Connection: close Content-Type: text/plain X-Original-Transfer-Encoding: chunked Content-Length: 14 Hello, World! string(3) "1.1" bool(true) int(200) string(2) "OK" array(7) { ["Date"]=> string(29) "Thu, 26 Aug 2010 12:51:28 GMT" ["Server"]=> string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6" ["Vary"]=> string(15) "Accept-Encoding" ["Connection"]=> string(5) "close" ["Content-Type"]=> string(10) "text/plain" ["X-Original-Transfer-Encoding"]=> string(7) "chunked" ["Content-Length"]=> int(14) } GET /cgi-bin/chunked.sh HTTP/1.1 Host: localhost Connection: close --- HTTP/1.1 200 OK Date: Wed, 25 Aug 2010 12:11:44 GMT Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT Etag: "2002a-0-48549d615a35c" Accept-Ranges: bytes Content-Length: 0 Vary: Accept-Encoding Connection: close Content-Type: text/plain X-Original-Content-Length: 0 string(3) "1.1" bool(true) int(200) string(2) "OK" array(10) { ["Date"]=> string(29) "Wed, 25 Aug 2010 12:11:44 GMT" ["Server"]=> string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6" ["Last-Modified"]=> string(29) "Wed, 28 Apr 2010 10:54:37 GMT" ["Etag"]=> string(23) ""2002a-0-48549d615a35c"" ["Accept-Ranges"]=> string(5) "bytes" ["Content-Length"]=> string(1) "0" ["Vary"]=> string(15) "Accept-Encoding" ["Connection"]=> string(5) "close" ["Content-Type"]=> string(10) "text/plain" ["X-Original-Content-Length"]=> string(1) "0" } GET /default/empty.txt HTTP/1.1 Host: localhost Connection: close HTTP/1.1 200 OK Date: Thu, 26 Aug 2010 09:55:09 GMT Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT Etag: "2002a-0-48549d615a35c" Accept-Ranges: bytes Vary: Accept-Encoding Connection: close Content-Type: text/plain X-Original-Content-Length: 20 X-Original-Content-Encoding: gzip string(3) "1.1" bool(true) int(200) string(2) "OK" array(10) { ["Date"]=> string(29) "Thu, 26 Aug 2010 09:55:09 GMT" ["Server"]=> string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6" ["Last-Modified"]=> string(29) "Wed, 28 Apr 2010 10:54:37 GMT" ["Etag"]=> string(23) ""2002a-0-48549d615a35c"" ["Accept-Ranges"]=> string(5) "bytes" ["Vary"]=> string(15) "Accept-Encoding" ["Connection"]=> string(5) "close" ["Content-Type"]=> string(10) "text/plain" ["X-Original-Content-Length"]=> string(2) "20" ["X-Original-Content-Encoding"]=> string(4) "gzip" } GET /default/empty.txt HTTP/1.1 Host: localhost Accept-Encoding: gzip Connection: close HTTP/1.1 200 OK Date: Thu, 26 Aug 2010 11:41:02 GMT Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6 X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Connection: close Content-Type: text/html X-Original-Transfer-Encoding: chunked Content-Length: 0 string(3) "1.1" bool(true) int(200) string(2) "OK" array(8) { ["Date"]=> string(29) "Thu, 26 Aug 2010 11:41:02 GMT" ["Server"]=> string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6" ["X-Powered-By"]=> string(9) "PHP/5.3.3" ["Vary"]=> string(15) "Accept-Encoding" ["Connection"]=> string(5) "close" ["Content-Type"]=> string(9) "text/html" ["X-Original-Transfer-Encoding"]=> string(7) "chunked" ["Content-Length"]=> int(0) } GET /default/empty.php HTTP/1.1 Connection: close Host: localhost HTTP/1.1 200 OK Date: Thu, 26 Aug 2010 12:51:28 GMT Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6 Vary: Accept-Encoding Connection: close Content-Type: text/plain X-Original-Transfer-Encoding: chunked Content-Length: 14 Hello, World! string(3) "1.1" bool(true) int(200) string(2) "OK" array(7) { ["Date"]=> string(29) "Thu, 26 Aug 2010 12:51:28 GMT" ["Server"]=> string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6" ["Vary"]=> string(15) "Accept-Encoding" ["Connection"]=> string(5) "close" ["Content-Type"]=> string(10) "text/plain" ["X-Original-Transfer-Encoding"]=> string(7) "chunked" ["Content-Length"]=> int(14) } GET /cgi-bin/chunked.sh HTTP/1.1 Host: localhost Connection: close Done
[+]
..
[-] message004.phpt
[edit]
[-] url002.phpt
[edit]
[-] messagebody007.phpt
[edit]
[-] header007.phpt
[edit]
[-] clientrequest002.phpt
[edit]
[-] params010.phpt
[edit]
[-] client010.phpt
[edit]
[-] params004.phpt
[edit]
[-] client005.phpt
[edit]
[-] bug61444.phpt
[edit]
[-] urlparser002.phpt
[edit]
[-] params009.phpt
[edit]
[-] bug69313.phpt
[edit]
[-] cookie007.phpt
[edit]
[-] urlparser010.phpt
[edit]
[-] params006.phpt
[edit]
[-] bug69076.phpt
[edit]
[-] params002.phpt
[edit]
[-] urlparser011.phpt
[edit]
[-] gh-issue11.phpt
[edit]
[-] header005.phpt
[edit]
[-] message005.phpt
[edit]
[-] client026.phpt
[edit]
[-] gh-issue92.phpt
[edit]
[-] filterchunked.phpt
[edit]
[-] params017.phpt
[edit]
[-] message009.phpt
[edit]
[-] headerparser003.phpt
[edit]
[-] params015.phpt
[edit]
[-] header002.phpt
[edit]
[-] etag001.phpt
[edit]
[-] client023.phpt
[edit]
[-] client025.phpt
[edit]
[-] urlparser013.phpt
[edit]
[-] messagebody009.phpt
[edit]
[-] serialize001.phpt
[edit]
[-] messagebody002.phpt
[edit]
[-] filterbrotli.phpt
[edit]
[-] bug67932.phpt
[edit]
[-] client002.phpt
[edit]
[-] messagebody003.phpt
[edit]
[-] message012.phpt
[edit]
[-] header008.phpt
[edit]
[-] urlparser005.phpt
[edit]
[-] params016.phpt
[edit]
[-] cookie006.phpt
[edit]
[-] cookie010.phpt
[edit]
[-] cookie009.phpt
[edit]
[-] urlparser009.phpt
[edit]
[-] client007.phpt
[edit]
[-] gh-issue42.phpt
[edit]
[-] message015.phpt
[edit]
[-] headerparser002.phpt
[edit]
[-] querystring001_a.phpt
[edit]
[-] querystring003.phpt
[edit]
[-] url004.phpt
[edit]
[-] cookie003.phpt
[edit]
[-] client001.phpt
[edit]
[-] client014.phpt
[edit]
[-] urlparser003.phpt
[edit]
[-] urlparser007.phpt
[edit]
[-] urlparser006.phpt
[edit]
[-] urlparser004.phpt
[edit]
[-] params003.phpt
[edit]
[-] client017.phpt
[edit]
[-] version001.phpt
[edit]
[-] message003.phpt
[edit]
[-] clientrequest001.phpt
[edit]
[-] cookie004.phpt
[edit]
[-] params007.phpt
[edit]
[-] header001.phpt
[edit]
[-] client020.phpt
[edit]
[-] skipif.inc
[edit]
[-] urlparser001.phpt
[edit]
[-] header003.phpt
[edit]
[-] client009.phpt
[edit]
[-] client022.phpt
[edit]
[-] messagebody010.phpt
[edit]
[-] client032.phpt
[edit]
[-] params008.phpt
[edit]
[-] headerparser001.phpt
[edit]
[-] bug73055.phpt
[edit]
[-] client004.phpt
[edit]
[-] info002.phpt
[edit]
[-] info001.phpt
[edit]
[-] params001.phpt
[edit]
[-] params013.phpt
[edit]
[+]
data
[-] messagebody006.phpt
[edit]
[-] message016.phpt
[edit]
[-] url003.phpt
[edit]
[-] messageparser001.phpt
[edit]
[-] bug69000.phpt
[edit]
[-] clientrequest003.phpt
[edit]
[-] header009.phpt
[edit]
[-] message011.phpt
[edit]
[-] messageparser002.phpt
[edit]
[-] urlparser008.phpt
[edit]
[-] client012.phpt
[edit]
[-] cookie002.phpt
[edit]
[-] client013.phpt
[edit]
[-] urlparser012.phpt
[edit]
[-] client019.phpt
[edit]
[-] message010.phpt
[edit]
[+]
helper
[-] client003.phpt
[edit]
[-] params005.phpt
[edit]
[-] messagebody008.phpt
[edit]
[-] client011.phpt
[edit]
[-] client006.phpt
[edit]
[-] cookie011.phpt
[edit]
[-] cookie005.phpt
[edit]
[-] clientresponse002.phpt
[edit]
[-] querystring002.phpt
[edit]
[-] bug66388.phpt
[edit]
[-] messagebody004.phpt
[edit]
[-] phpinfo.phpt
[edit]
[-] params012.phpt
[edit]
[-] gh-issue63.phpt
[edit]
[-] message007.phpt
[edit]
[-] gh-issue50.phpt
[edit]
[-] clientrequest004.phpt
[edit]
[-] clientresponse001.phpt
[edit]
[-] url001.phpt
[edit]
[-] message013.phpt
[edit]
[-] cookie008.phpt
[edit]
[-] header004.phpt
[edit]
[-] message014.phpt
[edit]
[-] params011.phpt
[edit]
[-] client031.phpt
[edit]
[-] cookie012.phpt
[edit]
[-] client029.phpt
[edit]
[-] client024.phpt
[edit]
[-] url005.phpt
[edit]
[-] clientresponse003.phpt
[edit]
[-] messagebody005.phpt
[edit]
[-] messagebody001.phpt
[edit]
[-] cookie001.phpt
[edit]
[-] params014.phpt
[edit]
[-] bug69357.phpt
[edit]
[-] message001.phpt
[edit]
[-] header006.phpt
[edit]