From ef1b4f269873f0639a88da3db0f3d8786760633e Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Thu, 11 Sep 2008 11:52:02 +0000 Subject: [PATCH] Added tests --- ext/session/tests/rfc1867.phpt | 127 ++++++++++++++++++ ext/session/tests/rfc1867_disabled.phpt | 75 +++++++++++ ext/session/tests/rfc1867_disabled_2.phpt | 75 +++++++++++ .../tests/rfc1867_invalid_settings.phpt | 15 +++ .../tests/rfc1867_invalid_settings_2.phpt | 15 +++ ext/session/tests/rfc1867_no_name.phpt | 75 +++++++++++ ext/session/tests/rfc1867_sid_cookie.phpt | 127 ++++++++++++++++++ ext/session/tests/rfc1867_sid_get.phpt | 125 +++++++++++++++++ ext/session/tests/rfc1867_sid_get_2.phpt | 127 ++++++++++++++++++ ext/session/tests/rfc1867_sid_invalid.phpt | 78 +++++++++++ .../tests/rfc1867_sid_only_cookie.phpt | 127 ++++++++++++++++++ .../tests/rfc1867_sid_only_cookie_2.phpt | 79 +++++++++++ ext/session/tests/rfc1867_sid_post.phpt | 123 +++++++++++++++++ 13 files changed, 1168 insertions(+) create mode 100644 ext/session/tests/rfc1867.phpt create mode 100644 ext/session/tests/rfc1867_disabled.phpt create mode 100644 ext/session/tests/rfc1867_disabled_2.phpt create mode 100644 ext/session/tests/rfc1867_invalid_settings.phpt create mode 100644 ext/session/tests/rfc1867_invalid_settings_2.phpt create mode 100644 ext/session/tests/rfc1867_no_name.phpt create mode 100644 ext/session/tests/rfc1867_sid_cookie.phpt create mode 100644 ext/session/tests/rfc1867_sid_get.phpt create mode 100644 ext/session/tests/rfc1867_sid_get_2.phpt create mode 100644 ext/session/tests/rfc1867_sid_invalid.phpt create mode 100644 ext/session/tests/rfc1867_sid_only_cookie.phpt create mode 100644 ext/session/tests/rfc1867_sid_only_cookie_2.phpt create mode 100644 ext/session/tests/rfc1867_sid_post.phpt diff --git a/ext/session/tests/rfc1867.phpt b/ext/session/tests/rfc1867.phpt new file mode 100644 index 0000000000..45373aa2d1 --- /dev/null +++ b/ext/session/tests/rfc1867.phpt @@ -0,0 +1,127 @@ +--TEST-- +session rfc1867 +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=1 +session.use_only_cookies=0 +session.upload_progress.enabled=1 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=1% +--SKIPIF-- + +--COOKIE-- +PHPSESSID=rfc1867-tests +--GET-- +PHPSESSID=rfc1867-tests-get +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHPSESSID" + +rfc1867-tests-post +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS" + +rfc1867.php +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +string(%d) "rfc1867-tests" +bool(true) +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +array(5) { + [%u|b%"start_time"]=> + int(%d) + [%u|b%"content_length"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(%d) + [%u|b%"done"]=> + bool(true) + [%u|b%"files"]=> + array(2) { + [0]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file1" + [%u|b%"name"]=> + %unicode|string%(9) "file1.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + [1]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file2" + [%u|b%"name"]=> + %unicode|string%(9) "file2.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + } +} diff --git a/ext/session/tests/rfc1867_disabled.phpt b/ext/session/tests/rfc1867_disabled.phpt new file mode 100644 index 0000000000..054097ea03 --- /dev/null +++ b/ext/session/tests/rfc1867_disabled.phpt @@ -0,0 +1,75 @@ +--TEST-- +session rfc1867 disabled +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=1 +session.use_only_cookies=0 +session.upload_progress.enabled=0 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=1% +--SKIPIF-- + +--COOKIE-- +PHPSESSID=rfc1867-tests +--GET-- +PHPSESSID=rfc1867-tests-get +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHPSESSID" + +rfc1867-tests-post +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +string(%d) "rfc1867-tests" +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +NULL diff --git a/ext/session/tests/rfc1867_disabled_2.phpt b/ext/session/tests/rfc1867_disabled_2.phpt new file mode 100644 index 0000000000..c8ca5724cd --- /dev/null +++ b/ext/session/tests/rfc1867_disabled_2.phpt @@ -0,0 +1,75 @@ +--TEST-- +session rfc1867 disabled 2 +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=1 +session.use_only_cookies=0 +session.upload_progress.enabled=1 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=1% +--SKIPIF-- + +--COOKIE-- +PHPSESSID=rfc1867-tests +--GET-- +PHPSESSID=rfc1867-tests-get +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHPSESSID" + +rfc1867-tests-post +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +string(%d) "rfc1867-tests" +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +NULL diff --git a/ext/session/tests/rfc1867_invalid_settings.phpt b/ext/session/tests/rfc1867_invalid_settings.phpt new file mode 100644 index 0000000000..e973a1bd5f --- /dev/null +++ b/ext/session/tests/rfc1867_invalid_settings.phpt @@ -0,0 +1,15 @@ +--TEST-- +session rfc1867 invalid settings +--INI-- +session.upload_progress.freq=-1 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +PHP Warning: PHP Startup: session.upload_progress.freq must be greater than or equal to zero in %s + +Warning: PHP Startup: session.upload_progress.freq must be greater than or equal to zero in %s +%unicode|string%(%d) "1%" diff --git a/ext/session/tests/rfc1867_invalid_settings_2.phpt b/ext/session/tests/rfc1867_invalid_settings_2.phpt new file mode 100644 index 0000000000..7853a68511 --- /dev/null +++ b/ext/session/tests/rfc1867_invalid_settings_2.phpt @@ -0,0 +1,15 @@ +--TEST-- +session rfc1867 invalid settings 2 +--INI-- +session.upload_progress.freq=200% +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +PHP Warning: PHP Startup: session.upload_progress.freq cannot be over 100% in %s + +Warning: PHP Startup: session.upload_progress.freq cannot be over 100% in %s +%unicode|string%(%d) "1%" diff --git a/ext/session/tests/rfc1867_no_name.phpt b/ext/session/tests/rfc1867_no_name.phpt new file mode 100644 index 0000000000..82cf30f400 --- /dev/null +++ b/ext/session/tests/rfc1867_no_name.phpt @@ -0,0 +1,75 @@ +--TEST-- +session rfc1867 no name +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=1 +session.use_only_cookies=0 +session.upload_progress.enabled=1 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=1% +--SKIPIF-- + +--COOKIE-- +PHPSESSID=rfc1867-tests +--GET-- +PHPSESSID=rfc1867-tests-get +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHPSESSID" + +rfc1867-tests-post +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +string(%d) "rfc1867-tests" +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +NULL diff --git a/ext/session/tests/rfc1867_sid_cookie.phpt b/ext/session/tests/rfc1867_sid_cookie.phpt new file mode 100644 index 0000000000..b1591f4448 --- /dev/null +++ b/ext/session/tests/rfc1867_sid_cookie.phpt @@ -0,0 +1,127 @@ +--TEST-- +session rfc1867 sid cookie +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=1 +session.use_only_cookies=0 +session.upload_progress.enabled=1 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=0 +--SKIPIF-- + +--COOKIE-- +PHPSESSID=rfc1867-tests +--GET-- +PHPSESSID=rfc1867-tests-get +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHPSESSID" + +rfc1867-tests-post +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS" + +rfc1867_sid_cookie.php +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +string(%d) "rfc1867-tests" +bool(true) +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +array(5) { + [%u|b%"start_time"]=> + int(%d) + [%u|b%"content_length"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(%d) + [%u|b%"done"]=> + bool(true) + [%u|b%"files"]=> + array(2) { + [0]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file1" + [%u|b%"name"]=> + %unicode|string%(9) "file1.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + [1]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file2" + [%u|b%"name"]=> + %unicode|string%(9) "file2.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + } +} diff --git a/ext/session/tests/rfc1867_sid_get.phpt b/ext/session/tests/rfc1867_sid_get.phpt new file mode 100644 index 0000000000..6a2a2b1e19 --- /dev/null +++ b/ext/session/tests/rfc1867_sid_get.phpt @@ -0,0 +1,125 @@ +--TEST-- +session rfc1867 sid get +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=1 +session.use_only_cookies=0 +session.upload_progress.enabled=1 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=0 +--SKIPIF-- + +--GET-- +PHPSESSID=rfc1867-tests +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHPSESSID" + +rfc1867-tests-post +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS" + +rfc1867_sid_get.php +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +string(%d) "rfc1867-tests" +bool(true) +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +array(5) { + [%u|b%"start_time"]=> + int(%d) + [%u|b%"content_length"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(%d) + [%u|b%"done"]=> + bool(true) + [%u|b%"files"]=> + array(2) { + [0]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file1" + [%u|b%"name"]=> + %unicode|string%(9) "file1.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + [1]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file2" + [%u|b%"name"]=> + %unicode|string%(9) "file2.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + } +} diff --git a/ext/session/tests/rfc1867_sid_get_2.phpt b/ext/session/tests/rfc1867_sid_get_2.phpt new file mode 100644 index 0000000000..9b65ee575f --- /dev/null +++ b/ext/session/tests/rfc1867_sid_get_2.phpt @@ -0,0 +1,127 @@ +--TEST-- +session rfc1867 sid get 2 +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=0 +session.use_only_cookies=0 +session.upload_progress.enabled=1 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=0 +--SKIPIF-- + +--COOKIE-- +PHPSESSID=rfc1867-tests-cookie +--GET-- +PHPSESSID=rfc1867-tests +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHPSESSID" + +rfc1867-tests-post +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS" + +rfc1867_sid_get_2.php +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +string(%d) "rfc1867-tests" +bool(true) +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +array(5) { + [%u|b%"start_time"]=> + int(%d) + [%u|b%"content_length"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(%d) + [%u|b%"done"]=> + bool(true) + [%u|b%"files"]=> + array(2) { + [0]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file1" + [%u|b%"name"]=> + %unicode|string%(9) "file1.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + [1]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file2" + [%u|b%"name"]=> + %unicode|string%(9) "file2.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + } +} diff --git a/ext/session/tests/rfc1867_sid_invalid.phpt b/ext/session/tests/rfc1867_sid_invalid.phpt new file mode 100644 index 0000000000..f4bc95f090 --- /dev/null +++ b/ext/session/tests/rfc1867_sid_invalid.phpt @@ -0,0 +1,78 @@ +--TEST-- +session rfc1867 sid cookie +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=1 +session.use_only_cookies=0 +session.auto_start=0 +session.upload_progress.enabled=1 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=0 +--SKIPIF-- + +--COOKIE-- +PHPSESSID=_ +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS" + +rfc1867_sid_invalid.php +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +Warning: Unknown: The session id contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0 +string(%d) "%s" +bool(true) +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +NULL diff --git a/ext/session/tests/rfc1867_sid_only_cookie.phpt b/ext/session/tests/rfc1867_sid_only_cookie.phpt new file mode 100644 index 0000000000..334d661b0a --- /dev/null +++ b/ext/session/tests/rfc1867_sid_only_cookie.phpt @@ -0,0 +1,127 @@ +--TEST-- +session rfc1867 sid only cookie +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=1 +session.use_only_cookies=1 +session.upload_progress.enabled=1 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=0 +--SKIPIF-- + +--COOKIE-- +PHPSESSID=rfc1867-tests +--GET-- +PHPSESSID=rfc1867-tests-get +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHPSESSID" + +rfc1867-tests-post +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS" + +rfc1867_sid_only_cookie.php +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +string(%d) "rfc1867-tests" +bool(true) +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +array(5) { + [%u|b%"start_time"]=> + int(%d) + [%u|b%"content_length"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(%d) + [%u|b%"done"]=> + bool(true) + [%u|b%"files"]=> + array(2) { + [0]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file1" + [%u|b%"name"]=> + %unicode|string%(9) "file1.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + [1]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file2" + [%u|b%"name"]=> + %unicode|string%(9) "file2.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + } +} diff --git a/ext/session/tests/rfc1867_sid_only_cookie_2.phpt b/ext/session/tests/rfc1867_sid_only_cookie_2.phpt new file mode 100644 index 0000000000..b0062c399f --- /dev/null +++ b/ext/session/tests/rfc1867_sid_only_cookie_2.phpt @@ -0,0 +1,79 @@ +--TEST-- +session rfc1867 sid only cookie 2 +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=1 +session.use_only_cookies=1 +session.upload_progress.enabled=1 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=0 +--SKIPIF-- + +--GET-- +PHPSESSID=rfc1867-tests-get +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHPSESSID" + +rfc1867-tests-post +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS" + +rfc1867_sid_only_cookie_2.php +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +string(%d) "%s" +bool(true) +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +NULL diff --git a/ext/session/tests/rfc1867_sid_post.phpt b/ext/session/tests/rfc1867_sid_post.phpt new file mode 100644 index 0000000000..7afe8b7c8f --- /dev/null +++ b/ext/session/tests/rfc1867_sid_post.phpt @@ -0,0 +1,123 @@ +--TEST-- +session rfc1867 sid post +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +session.save_path= +session.name=PHPSESSID +session.use_cookies=1 +session.use_only_cookies=0 +session.upload_progress.enabled=1 +session.upload_progress.prefix=upload_progress_ +session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS +session.upload_progress.freq=0 +--SKIPIF-- + +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHPSESSID" + +rfc1867-tests +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS" + +rfc1867_sid_post.php +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" + +2 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +string(%d) "rfc1867-tests" +bool(true) +array(2) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +array(5) { + [%u|b%"start_time"]=> + int(%d) + [%u|b%"content_length"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(%d) + [%u|b%"done"]=> + bool(true) + [%u|b%"files"]=> + array(2) { + [0]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file1" + [%u|b%"name"]=> + %unicode|string%(9) "file1.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + [1]=> + array(7) { + [%u|b%"field_name"]=> + %unicode|string%(5) "file2" + [%u|b%"name"]=> + %unicode|string%(9) "file2.txt" + [%u|b%"tmp_name"]=> + %unicode|string%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"done"]=> + bool(true) + [%u|b%"start_time"]=> + int(%d) + [%u|b%"bytes_processed"]=> + int(1) + } + } +} -- 2.50.1