diff options
Diffstat (limited to 'ext/session/tests')
| -rw-r--r-- | ext/session/tests/014.phpt | 12 | ||||
| -rw-r--r-- | ext/session/tests/015.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/018.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/020.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/021.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/bug36459.phpt | 83 | ||||
| -rw-r--r-- | ext/session/tests/bug41600.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/bug60634.phpt | 46 | ||||
| -rw-r--r-- | ext/session/tests/bug60634_error_1.phpt | 49 | ||||
| -rw-r--r-- | ext/session/tests/bug60634_error_2.phpt | 49 | ||||
| -rw-r--r-- | ext/session/tests/bug60634_error_3.phpt | 48 | ||||
| -rw-r--r-- | ext/session/tests/bug60634_error_4.phpt | 48 | ||||
| -rw-r--r-- | ext/session/tests/bug60634_error_5.phpt | 49 | ||||
| -rw-r--r-- | ext/session/tests/session_save_path_variation4.phpt | 5 |
14 files changed, 343 insertions, 51 deletions
diff --git a/ext/session/tests/014.phpt b/ext/session/tests/014.phpt index be1119d9a..09ad0f5b1 100644 --- a/ext/session/tests/014.phpt +++ b/ext/session/tests/014.phpt @@ -3,7 +3,7 @@ a script should not be able to modify session.use_trans_sid --SKIPIF-- <?php include('skipif.inc'); ?> --INI-- -session.use_trans_sid=1 +session.use_trans_sid=0 session.use_cookies=0 session.cache_limiter= register_globals=1 @@ -22,11 +22,11 @@ session_start(); ?> <a href="/link"> <?php -ini_set("session.use_trans_sid","0"); +ini_set("session.use_trans_sid","1"); ?> <a href="/link"> <?php -ini_set("session.use_trans_sid","1"); +ini_set("session.use_trans_sid","0"); ?> <a href="/link"> <?php @@ -34,10 +34,10 @@ session_destroy(); ?> --EXPECTF-- Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0 -<a href="/link?PHPSESSID=abtest"> +<a href="/link"> Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line %d -<a href="/link?PHPSESSID=abtest"> +<a href="/link"> Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line %d -<a href="/link?PHPSESSID=abtest"> +<a href="/link"> diff --git a/ext/session/tests/015.phpt b/ext/session/tests/015.phpt index e747e08fb..7d7b73734 100644 --- a/ext/session/tests/015.phpt +++ b/ext/session/tests/015.phpt @@ -5,6 +5,7 @@ use_trans_sid should not affect SID --INI-- session.use_trans_sid=1 session.use_cookies=0 +session.use_only_cookies=0 session.cache_limiter= arg_separator.output=& session.name=PHPSESSID diff --git a/ext/session/tests/018.phpt b/ext/session/tests/018.phpt index 3450d1e3f..def1f419c 100644 --- a/ext/session/tests/018.phpt +++ b/ext/session/tests/018.phpt @@ -4,6 +4,7 @@ rewriter correctly handles attribute names which contain dashes <?php include('skipif.inc'); ?> --INI-- session.use_cookies=0 +session.use_only_cookies=0 session.cache_limiter= session.use_trans_sid=1 session.name=PHPSESSID diff --git a/ext/session/tests/020.phpt b/ext/session/tests/020.phpt index 82997a8f0..f43bac5d1 100644 --- a/ext/session/tests/020.phpt +++ b/ext/session/tests/020.phpt @@ -4,6 +4,7 @@ rewriter uses arg_seperator.output for modifying URLs <?php include('skipif.inc'); ?> --INI-- session.use_cookies=0 +session.use_only_cookies=0 session.cache_limiter= session.use_trans_sid=1 arg_separator.output="&" diff --git a/ext/session/tests/021.phpt b/ext/session/tests/021.phpt index 9d95b86d0..1ad3c5d5f 100644 --- a/ext/session/tests/021.phpt +++ b/ext/session/tests/021.phpt @@ -4,6 +4,7 @@ rewriter handles form and fieldset tags correctly <?php include('skipif.inc'); ?> --INI-- session.use_cookies=0 +session.use_only_cookies=0 session.cache_limiter= session.use_trans_sid=1 url_rewriter.tags="a=href,area=href,frame=src,input=src,form=,fieldset=" diff --git a/ext/session/tests/bug36459.phpt b/ext/session/tests/bug36459.phpt index 1488fb4dd..66a4ac1cb 100644 --- a/ext/session/tests/bug36459.phpt +++ b/ext/session/tests/bug36459.phpt @@ -1,41 +1,42 @@ ---TEST-- -Bug #31454 (Incorrect adding PHPSESSID to links, which contains \r\n) ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_trans_sid=1 -session.use_cookies=0 -session.name=sid ---FILE-- -<?php -error_reporting(E_ALL); - -session_start(); - -# Do not remove \r from this tests, they are essential! -?> -<html> - <head> - <title>Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n</title> - </head> - <body> - <p>See source html code</p> - <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2" - style="font: normal 11pt Times New Roman">incorrect link</a><br /> - <br /> - <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2" style="font: normal 11pt Times New Roman">correct link</a> - </body> -</html> ---EXPECTF-- -<html> - <head> - <title>Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n</title> - </head> - <body> - <p>See source html code</p> - <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2&sid=%s" - style="font: normal 11pt Times New Roman">incorrect link</a><br /> - <br /> - <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2&sid=%s" style="font: normal 11pt Times New Roman">correct link</a> - </body> -</html> +--TEST--
+Bug #31454 (Incorrect adding PHPSESSID to links, which contains \r\n)
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--INI--
+session.use_trans_sid=1
+session.use_cookies=0
+session.use_only_cookies=0
+session.name=sid
+--FILE--
+<?php
+error_reporting(E_ALL);
+
+session_start();
+
+# Do not remove \r from this tests, they are essential!
+?>
+<html>
+ <head>
+ <title>Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n</title>
+ </head>
+ <body>
+ <p>See source html code</p>
+ <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2"
+ style="font: normal 11pt Times New Roman">incorrect link</a><br />
+ <br />
+ <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2" style="font: normal 11pt Times New Roman">correct link</a>
+ </body>
+</html>
+--EXPECTF--
+<html>
+ <head>
+ <title>Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n</title>
+ </head>
+ <body>
+ <p>See source html code</p>
+ <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2&sid=%s"
+ style="font: normal 11pt Times New Roman">incorrect link</a><br />
+ <br />
+ <a href="/b2w/www/ru/adm/pages/?action=prev&rec_id=8&pid=2&sid=%s" style="font: normal 11pt Times New Roman">correct link</a>
+ </body>
+</html>
diff --git a/ext/session/tests/bug41600.phpt b/ext/session/tests/bug41600.phpt index 028fca79a..690347ac8 100644 --- a/ext/session/tests/bug41600.phpt +++ b/ext/session/tests/bug41600.phpt @@ -4,6 +4,7 @@ Bug #41600 (url rewriter tags doesn't work with namespaced tags) <?php include('skipif.inc'); ?> --INI-- session.use_cookies=0 +session.use_only_cookies=0 session.cache_limiter= session.use_trans_sid=1 arg_separator.output="&" diff --git a/ext/session/tests/bug60634.phpt b/ext/session/tests/bug60634.phpt new file mode 100644 index 000000000..2ec0c26c1 --- /dev/null +++ b/ext/session/tests/bug60634.phpt @@ -0,0 +1,46 @@ +--TEST-- +Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) +--XFAIL-- +Long term low priority bug, working on it +--INI-- +session.save_path= +session.name=PHPSESSID +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php + +ob_start(); + +function open($save_path, $session_name) { + return true; +} + +function close() { + die("close: goodbye cruel world\n"); +} + +function read($id) { + return ''; +} + +function write($id, $session_data) { + die("write: goodbye cruel world\n"); +} + +function destroy($id) { + return true; +} + +function gc($maxlifetime) { + return true; +} + +session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc'); +session_start(); +session_write_close(); +echo "um, hi\n"; + +?> +--EXPECTF-- +write: goodbye cruel world diff --git a/ext/session/tests/bug60634_error_1.phpt b/ext/session/tests/bug60634_error_1.phpt new file mode 100644 index 000000000..3b6e394ee --- /dev/null +++ b/ext/session/tests/bug60634_error_1.phpt @@ -0,0 +1,49 @@ +--TEST-- +Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write during exec +--XFAIL-- +Long term low priority bug, working on it +--INI-- +session.save_path= +session.name=PHPSESSID +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php + +ob_start(); + +function open($save_path, $session_name) { + return true; +} + +function close() { + echo "close: goodbye cruel world\n"; +} + +function read($id) { + return ''; +} + +function write($id, $session_data) { + echo "write: goodbye cruel world\n"; + undefined_function(); +} + +function destroy($id) { + return true; +} + +function gc($maxlifetime) { + return true; +} + +session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc'); +session_start(); +session_write_close(); +echo "um, hi\n"; + +?> +--EXPECTF-- +write: goodbye cruel world + +Fatal error: Call to undefined function undefined_function() in %s on line %d diff --git a/ext/session/tests/bug60634_error_2.phpt b/ext/session/tests/bug60634_error_2.phpt new file mode 100644 index 000000000..265fb303f --- /dev/null +++ b/ext/session/tests/bug60634_error_2.phpt @@ -0,0 +1,49 @@ +--TEST-- +Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write during exec +--XFAIL-- +Long term low priority bug, working on it +--INI-- +session.save_path= +session.name=PHPSESSID +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php + +ob_start(); + +function open($save_path, $session_name) { + return true; +} + +function close() { + echo "close: goodbye cruel world\n"; +} + +function read($id) { + return ''; +} + +function write($id, $session_data) { + echo "write: goodbye cruel world\n"; + throw new Exception; +} + +function destroy($id) { + return true; +} + +function gc($maxlifetime) { + return true; +} + +session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc'); +session_start(); +session_write_close(); +echo "um, hi\n"; + +?> +--EXPECTF-- +write: goodbye cruel world + +Fatal error: Uncaught exception 'Exception' in %s diff --git a/ext/session/tests/bug60634_error_3.phpt b/ext/session/tests/bug60634_error_3.phpt new file mode 100644 index 000000000..b2004d68b --- /dev/null +++ b/ext/session/tests/bug60634_error_3.phpt @@ -0,0 +1,48 @@ +--TEST-- +Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write after exec +--XFAIL-- +Long term low priority bug, working on it +--INI-- +session.save_path= +session.name=PHPSESSID +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php + +ob_start(); + +function open($save_path, $session_name) { + return true; +} + +function close() { + echo "close: goodbye cruel world\n"; + exit; +} + +function read($id) { + return ''; +} + +function write($id, $session_data) { + echo "write: goodbye cruel world\n"; + undefined_function(); +} + +function destroy($id) { + return true; +} + +function gc($maxlifetime) { + return true; +} + +session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc'); +session_start(); + +?> +--EXPECTF-- +write: goodbye cruel world + +Fatal error: Call to undefined function undefined_function() in %s on line %d diff --git a/ext/session/tests/bug60634_error_4.phpt b/ext/session/tests/bug60634_error_4.phpt new file mode 100644 index 000000000..60bc0dcf5 --- /dev/null +++ b/ext/session/tests/bug60634_error_4.phpt @@ -0,0 +1,48 @@ +--TEST-- +Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write after exec +--XFAIL-- +Long term low priority bug, working on it +--INI-- +session.save_path= +session.name=PHPSESSID +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php + +ob_start(); + +function open($save_path, $session_name) { + return true; +} + +function close() { + echo "close: goodbye cruel world\n"; + exit; +} + +function read($id) { + return ''; +} + +function write($id, $session_data) { + echo "write: goodbye cruel world\n"; + throw new Exception; +} + +function destroy($id) { + return true; +} + +function gc($maxlifetime) { + return true; +} + +session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc'); +session_start(); + +?> +--EXPECTF-- +write: goodbye cruel world + +Fatal error: Uncaught exception 'Exception' in %s diff --git a/ext/session/tests/bug60634_error_5.phpt b/ext/session/tests/bug60634_error_5.phpt new file mode 100644 index 000000000..376b65f20 --- /dev/null +++ b/ext/session/tests/bug60634_error_5.phpt @@ -0,0 +1,49 @@ +--TEST-- +Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in close during exec +--XFAIL-- +Long term low priority bug, working on it +--INI-- +session.save_path= +session.name=PHPSESSID +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php + +ob_start(); + +function open($save_path, $session_name) { + return true; +} + +function close() { + echo "close: goodbye cruel world\n"; + undefined_function(); +} + +function read($id) { + return ''; +} + +function write($id, $session_data) { + return true; +} + +function destroy($id) { + return true; +} + +function gc($maxlifetime) { + return true; +} + +session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc'); +session_start(); +session_write_close(); +echo "um, hi\n"; + +?> +--EXPECTF-- +close: goodbye cruel world + +Fatal error: Call to undefined function undefined_function() in %s on line %d diff --git a/ext/session/tests/session_save_path_variation4.phpt b/ext/session/tests/session_save_path_variation4.phpt index 6ea725cd8..80db6caf7 100644 --- a/ext/session/tests/session_save_path_variation4.phpt +++ b/ext/session/tests/session_save_path_variation4.phpt @@ -1,10 +1,7 @@ --TEST-- Test session_save_path() function : variation --SKIPIF-- -<?php include('skipif.inc'); -if(substr(PHP_OS, 0, 3) != "WIN") - die("skip Only for Windows"); -?> +<?php include('skipif.inc');?> --INI-- open_basedir=. session.save_handler=files |
