summaryrefslogtreecommitdiff
path: root/ext/session/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/session/tests')
-rw-r--r--ext/session/tests/004.phpt1
-rw-r--r--ext/session/tests/005.phpt2
-rw-r--r--ext/session/tests/006.phpt3
-rw-r--r--ext/session/tests/009.phpt1
-rw-r--r--ext/session/tests/024.phpt1
-rw-r--r--ext/session/tests/025.phpt2
-rw-r--r--ext/session/tests/026.phpt1
-rw-r--r--ext/session/tests/027.phpt1
-rw-r--r--ext/session/tests/bug36459.phpt84
-rw-r--r--ext/session/tests/bug60860.phpt9
-rw-r--r--ext/session/tests/bug66481.phpt1
-rw-r--r--ext/session/tests/bug73100.phpt10
-rw-r--r--ext/session/tests/bug73529.phpt38
-rw-r--r--ext/session/tests/rfc1867.phpt74
-rw-r--r--ext/session/tests/rfc1867_cleanup.phpt24
-rw-r--r--ext/session/tests/rfc1867_disabled.phpt24
-rw-r--r--ext/session/tests/rfc1867_disabled_2.phpt24
-rw-r--r--ext/session/tests/rfc1867_inter.phpt74
-rw-r--r--ext/session/tests/rfc1867_no_name.phpt24
-rw-r--r--ext/session/tests/rfc1867_sid_cookie.phpt74
-rw-r--r--ext/session/tests/rfc1867_sid_get.phpt74
-rw-r--r--ext/session/tests/rfc1867_sid_get_2.phpt74
-rw-r--r--ext/session/tests/rfc1867_sid_invalid.phpt75
-rw-r--r--ext/session/tests/rfc1867_sid_only_cookie.phpt74
-rw-r--r--ext/session/tests/rfc1867_sid_only_cookie_2.phpt24
-rw-r--r--ext/session/tests/rfc1867_sid_post.phpt74
-rw-r--r--ext/session/tests/save_handler.inc96
-rw-r--r--ext/session/tests/session_basic1.phpt4
-rw-r--r--ext/session/tests/session_basic2.phpt4
-rw-r--r--ext/session/tests/session_basic3.phpt2
-rw-r--r--ext/session/tests/session_basic5.phpt2
-rw-r--r--ext/session/tests/session_cache_expire_basic.phpt2
-rw-r--r--ext/session/tests/session_cache_expire_variation1.phpt2
-rw-r--r--ext/session/tests/session_cache_expire_variation2.phpt2
-rw-r--r--ext/session/tests/session_cache_expire_variation3.phpt2
-rw-r--r--ext/session/tests/session_cache_limiter_basic.phpt11
-rw-r--r--ext/session/tests/session_cache_limiter_variation1.phpt15
-rw-r--r--ext/session/tests/session_cache_limiter_variation2.phpt15
-rw-r--r--ext/session/tests/session_cache_limiter_variation3.phpt7
-rw-r--r--ext/session/tests/session_commit_basic.phpt2
-rw-r--r--ext/session/tests/session_commit_error.phpt49
-rw-r--r--ext/session/tests/session_commit_variation1.phpt11
-rw-r--r--ext/session/tests/session_commit_variation2.phpt6
-rw-r--r--ext/session/tests/session_commit_variation3.phpt2
-rw-r--r--ext/session/tests/session_commit_variation4.phpt6
-rw-r--r--ext/session/tests/session_commit_variation5.phpt6
-rw-r--r--ext/session/tests/session_encode_error2.phpt2
-rw-r--r--ext/session/tests/session_encode_variation1.phpt2
-rw-r--r--ext/session/tests/session_get_cookie_params_basic.phpt4
-rw-r--r--ext/session/tests/session_ini_set.phpt182
-rw-r--r--ext/session/tests/session_module_name_variation3.phpt12
-rw-r--r--ext/session/tests/session_module_name_variation4.phpt2
-rw-r--r--ext/session/tests/session_save_path_error.phpt2
-rw-r--r--ext/session/tests/session_save_path_variation1.phpt25
-rw-r--r--ext/session/tests/session_save_path_variation4.phpt19
-rw-r--r--ext/session/tests/session_set_cookie_params_basic.phpt9
-rw-r--r--ext/session/tests/session_set_cookie_params_error.phpt293
-rw-r--r--ext/session/tests/session_set_cookie_params_variation1.phpt15
-rw-r--r--ext/session/tests/session_set_cookie_params_variation2.phpt13
-rw-r--r--ext/session/tests/session_set_cookie_params_variation3.phpt13
-rw-r--r--ext/session/tests/session_set_cookie_params_variation4.phpt13
-rw-r--r--ext/session/tests/session_set_cookie_params_variation5.phpt13
-rw-r--r--ext/session/tests/session_set_save_handler_class_005.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_class_012.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_class_014.phpt7
-rw-r--r--ext/session/tests/session_set_save_handler_error3.phpt10
-rw-r--r--ext/session/tests/session_set_save_handler_variation2.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_variation3.phpt7
-rw-r--r--ext/session/tests/session_set_save_handler_variation4.phpt4
-rw-r--r--ext/session/tests/session_set_save_handler_variation5.phpt4
-rw-r--r--ext/session/tests/session_start_variation1.phpt9
-rw-r--r--ext/session/tests/session_start_variation3.phpt13
-rw-r--r--ext/session/tests/session_start_variation5.phpt2
-rw-r--r--ext/session/tests/session_start_variation6.phpt2
-rw-r--r--ext/session/tests/session_start_variation9.phpt3
-rw-r--r--ext/session/tests/session_unset_basic.phpt2
-rw-r--r--ext/session/tests/session_unset_error.phpt97
-rw-r--r--ext/session/tests/session_unset_variation1.phpt2
-rw-r--r--ext/session/tests/session_write_close_basic.phpt2
-rw-r--r--ext/session/tests/session_write_close_error.phpt49
-rw-r--r--ext/session/tests/session_write_close_variation1.phpt11
-rw-r--r--ext/session/tests/session_write_close_variation2.phpt7
-rw-r--r--ext/session/tests/session_write_close_variation3.phpt2
-rw-r--r--ext/session/tests/session_write_close_variation4.phpt6
84 files changed, 1269 insertions, 708 deletions
diff --git a/ext/session/tests/004.phpt b/ext/session/tests/004.phpt
index 4547c65574..9e34b7123f 100644
--- a/ext/session/tests/004.phpt
+++ b/ext/session/tests/004.phpt
@@ -11,6 +11,7 @@ session.serialize_handler=php
--FILE--
<?php
error_reporting(E_ALL);
+ob_start();
class handler {
public $data = 'baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}';
diff --git a/ext/session/tests/005.phpt b/ext/session/tests/005.phpt
index 796d9c377e..3dbf859523 100644
--- a/ext/session/tests/005.phpt
+++ b/ext/session/tests/005.phpt
@@ -10,8 +10,8 @@ session.name=PHPSESSID
session.serialize_handler=php
--FILE--
<?php
-
error_reporting(E_ALL);
+ob_start();
class handler {
public $data = 'baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}';
diff --git a/ext/session/tests/006.phpt b/ext/session/tests/006.phpt
index 7653b8c167..c38987edff 100644
--- a/ext/session/tests/006.phpt
+++ b/ext/session/tests/006.phpt
@@ -11,6 +11,7 @@ session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
+ob_start();
session_id("abtest");
session_start();
@@ -18,7 +19,7 @@ session_start();
class a {
public $test = "hallo";
}
-
+
class b {
public $a;
function __construct(&$a) {
diff --git a/ext/session/tests/009.phpt b/ext/session/tests/009.phpt
index 6d8d11c331..9624df0ae8 100644
--- a/ext/session/tests/009.phpt
+++ b/ext/session/tests/009.phpt
@@ -11,6 +11,7 @@ session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
+ob_start();
session_id("abtest");
diff --git a/ext/session/tests/024.phpt b/ext/session/tests/024.phpt
index 2b273e2b2e..d417a82ca1 100644
--- a/ext/session/tests/024.phpt
+++ b/ext/session/tests/024.phpt
@@ -11,6 +11,7 @@ session.serialize_handler=php
--FILE--
<?php
error_reporting(E_ALL);
+ob_start();
class handler {
public $data = 'baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}';
diff --git a/ext/session/tests/025.phpt b/ext/session/tests/025.phpt
index a9ad8fb649..83ab6ca370 100644
--- a/ext/session/tests/025.phpt
+++ b/ext/session/tests/025.phpt
@@ -10,8 +10,8 @@ session.name=PHPSESSID
session.serialize_handler=php
--FILE--
<?php
-
error_reporting(E_ALL);
+ob_start();
class handler {
public $data = 'baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}';
diff --git a/ext/session/tests/026.phpt b/ext/session/tests/026.phpt
index d29d6b57d2..cc9a8de22c 100644
--- a/ext/session/tests/026.phpt
+++ b/ext/session/tests/026.phpt
@@ -11,6 +11,7 @@ session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
+ob_start();
session_id("abtest");
session_start();
diff --git a/ext/session/tests/027.phpt b/ext/session/tests/027.phpt
index 63828522fb..ebaf25467c 100644
--- a/ext/session/tests/027.phpt
+++ b/ext/session/tests/027.phpt
@@ -11,6 +11,7 @@ session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
+ob_start();
session_id("abtest");
diff --git a/ext/session/tests/bug36459.phpt b/ext/session/tests/bug36459.phpt
index 66a4ac1cbc..c1b6456174 100644
--- a/ext/session/tests/bug36459.phpt
+++ b/ext/session/tests/bug36459.phpt
@@ -1,42 +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.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>
+--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/bug60860.phpt b/ext/session/tests/bug60860.phpt
index 83185862f0..38a3796b68 100644
--- a/ext/session/tests/bug60860.phpt
+++ b/ext/session/tests/bug60860.phpt
@@ -1,9 +1,12 @@
--TEST--
Bug #60860 (session.save_handler=user without defined function core dumps)
--SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php
+include('skipif.inc');
+?>
--INI--
session.save_handler=user
+display_errors=off
--FILE--
<?php
@@ -12,6 +15,6 @@ echo "ok\n";
?>
--EXPECTF--
-Warning: session_start(): user session functions not defined in %s on line 3
+PHP Recoverable fatal error: PHP Startup: Cannot set 'user' save handler by ini_set() or session_module_name() in Unknown on line 0
+ok
-Fatal error: session_start(): Failed to initialize storage module: user (path:%s) in %s on line 3
diff --git a/ext/session/tests/bug66481.phpt b/ext/session/tests/bug66481.phpt
index cf6ad6a8d6..c75cb88d1c 100644
--- a/ext/session/tests/bug66481.phpt
+++ b/ext/session/tests/bug66481.phpt
@@ -6,6 +6,7 @@ session.name=
<?php include('skipif.inc'); ?>
--FILE--
<?php
+ob_start();
var_dump(session_name("foo"));
var_dump(session_name("bar"));
diff --git a/ext/session/tests/bug73100.phpt b/ext/session/tests/bug73100.phpt
index 3f3e92561a..b53ebc07b4 100644
--- a/ext/session/tests/bug73100.phpt
+++ b/ext/session/tests/bug73100.phpt
@@ -13,13 +13,15 @@ ob_start();
var_dump(session_start());
session_module_name("user");
var_dump(session_destroy());
+
+session_module_name("user");
?>
===DONE===
--EXPECTF--
bool(true)
-Warning: session_module_name(): A session is active. You cannot change the session module's ini settings at this time in %s on line %d
+Warning: session_module_name(): Cannot change save handler module when session is active in %s on line 4
+bool(true)
+
+Recoverable fatal error: session_module_name(): Cannot set 'user' save handler by ini_set() or session_module_name() in %s on line 7
-Warning: session_destroy(): Session object destruction failed in %s on line %d
-bool(false)
-===DONE===
diff --git a/ext/session/tests/bug73529.phpt b/ext/session/tests/bug73529.phpt
new file mode 100644
index 0000000000..a14c63bc7f
--- /dev/null
+++ b/ext/session/tests/bug73529.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Bug #73529 session_decode() silently fails on wrong input
+--XFAIL--
+session_decode() does not return proper status.
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+
+ini_set("session.serialize_handler", "php_serialize");
+session_start();
+
+$result1 = session_decode(serialize(["foo" => "bar"]));
+$session1 = $_SESSION;
+session_destroy();
+
+ini_set("session.serialize_handler", "php");
+session_start();
+
+$result2 = session_decode(serialize(["foo" => "bar"]));
+$session2 = $_SESSION;
+session_destroy();
+
+var_dump($result1);
+var_dump($session1);
+var_dump($result2);
+var_dump($session2);
+
+?>
+--EXPECT--
+bool(true)
+array(1) {
+ ["foo"]=>
+ string(3) "bar"
+}
+bool(false)
+array(0) {
+}
diff --git a/ext/session/tests/rfc1867.phpt b/ext/session/tests/rfc1867.phpt
index 2752888633..be021007d3 100644
--- a/ext/session/tests/rfc1867.phpt
+++ b/ext/session/tests/rfc1867.phpt
@@ -55,76 +55,76 @@ session_destroy();
string(%d) "rfc1867-tests"
bool(true)
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
array(5) {
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"content_length"]=>
+ ["content_length"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(%d)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"files"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file1"
+ ["name"]=>
+ string(9) "file1.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file2"
+ ["name"]=>
+ string(9) "file2.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(1)
}
}
diff --git a/ext/session/tests/rfc1867_cleanup.phpt b/ext/session/tests/rfc1867_cleanup.phpt
index 7bcbba3a39..d18a2d267d 100644
--- a/ext/session/tests/rfc1867_cleanup.phpt
+++ b/ext/session/tests/rfc1867_cleanup.phpt
@@ -55,30 +55,30 @@ session_destroy();
string(%d) "rfc1867-tests"
bool(true)
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
diff --git a/ext/session/tests/rfc1867_disabled.phpt b/ext/session/tests/rfc1867_disabled.phpt
index 92047daef3..973cd5bd5f 100644
--- a/ext/session/tests/rfc1867_disabled.phpt
+++ b/ext/session/tests/rfc1867_disabled.phpt
@@ -48,30 +48,30 @@ session_destroy();
--EXPECTF--
string(%d) "rfc1867-tests"
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
diff --git a/ext/session/tests/rfc1867_disabled_2.phpt b/ext/session/tests/rfc1867_disabled_2.phpt
index 1dfac334ac..bc4b0e6c40 100644
--- a/ext/session/tests/rfc1867_disabled_2.phpt
+++ b/ext/session/tests/rfc1867_disabled_2.phpt
@@ -48,30 +48,30 @@ session_destroy();
--EXPECTF--
string(%d) "rfc1867-tests"
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
diff --git a/ext/session/tests/rfc1867_inter.phpt b/ext/session/tests/rfc1867_inter.phpt
index 73ff6e8f80..431300b6bb 100644
--- a/ext/session/tests/rfc1867_inter.phpt
+++ b/ext/session/tests/rfc1867_inter.phpt
@@ -58,76 +58,76 @@ session_destroy();
--EXPECTF--
string(%d) "rfc1867-tests"
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
array(5) {
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"content_length"]=>
+ ["content_length"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(%d)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"files"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file1"
+ ["name"]=>
+ string(9) "file1.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file2"
+ ["name"]=>
+ string(9) "file2.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(1)
}
}
diff --git a/ext/session/tests/rfc1867_no_name.phpt b/ext/session/tests/rfc1867_no_name.phpt
index 6a6eb71176..949e7aaf4b 100644
--- a/ext/session/tests/rfc1867_no_name.phpt
+++ b/ext/session/tests/rfc1867_no_name.phpt
@@ -48,30 +48,30 @@ session_destroy();
--EXPECTF--
string(%d) "rfc1867-tests"
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
diff --git a/ext/session/tests/rfc1867_sid_cookie.phpt b/ext/session/tests/rfc1867_sid_cookie.phpt
index 0c6ca61c58..28ac2605a6 100644
--- a/ext/session/tests/rfc1867_sid_cookie.phpt
+++ b/ext/session/tests/rfc1867_sid_cookie.phpt
@@ -54,76 +54,76 @@ session_destroy();
string(%d) "rfc1867-tests"
bool(true)
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
array(5) {
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"content_length"]=>
+ ["content_length"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(%d)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"files"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file1"
+ ["name"]=>
+ string(9) "file1.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file2"
+ ["name"]=>
+ string(9) "file2.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(1)
}
}
diff --git a/ext/session/tests/rfc1867_sid_get.phpt b/ext/session/tests/rfc1867_sid_get.phpt
index fc82f14163..93600b4834 100644
--- a/ext/session/tests/rfc1867_sid_get.phpt
+++ b/ext/session/tests/rfc1867_sid_get.phpt
@@ -52,76 +52,76 @@ session_destroy();
string(%d) "rfc1867-tests"
bool(true)
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
array(5) {
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"content_length"]=>
+ ["content_length"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(%d)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"files"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file1"
+ ["name"]=>
+ string(9) "file1.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file2"
+ ["name"]=>
+ string(9) "file2.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(1)
}
}
diff --git a/ext/session/tests/rfc1867_sid_get_2.phpt b/ext/session/tests/rfc1867_sid_get_2.phpt
index fadb196d15..bb418c7bbf 100644
--- a/ext/session/tests/rfc1867_sid_get_2.phpt
+++ b/ext/session/tests/rfc1867_sid_get_2.phpt
@@ -54,76 +54,76 @@ session_destroy();
string(%d) "rfc1867-tests"
bool(true)
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
array(5) {
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"content_length"]=>
+ ["content_length"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(%d)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"files"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file1"
+ ["name"]=>
+ string(9) "file1.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file2"
+ ["name"]=>
+ string(9) "file2.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(1)
}
}
diff --git a/ext/session/tests/rfc1867_sid_invalid.phpt b/ext/session/tests/rfc1867_sid_invalid.phpt
index ac288d4109..86cff6c089 100644
--- a/ext/session/tests/rfc1867_sid_invalid.phpt
+++ b/ext/session/tests/rfc1867_sid_invalid.phpt
@@ -39,6 +39,7 @@ Content-Disposition: form-data; name="file2"; filename="file2.txt"
--FILE--
<?php
error_reporting(0);
+ob_start();
session_start();
var_dump(session_id());
var_dump(basename(__FILE__) == $_POST[ini_get("session.upload_progress.name")]);
@@ -58,34 +59,80 @@ Warning: Unknown: The session id is too long or contains illegal characters, val
Warning: Unknown: Failed to read session data: files (path: ) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
-string(%d) "%s"
+string(%d) ""
bool(true)
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
-NULL
+array(5) {
+ ["start_time"]=>
+ int(%d)
+ ["content_length"]=>
+ int(469)
+ ["bytes_processed"]=>
+ int(469)
+ ["done"]=>
+ bool(true)
+ ["files"]=>
+ array(2) {
+ [0]=>
+ array(7) {
+ ["field_name"]=>
+ string(5) "file1"
+ ["name"]=>
+ string(9) "file1.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
+ int(0)
+ ["done"]=>
+ bool(true)
+ ["start_time"]=>
+ int(%d)
+ ["bytes_processed"]=>
+ int(1)
+ }
+ [1]=>
+ array(7) {
+ ["field_name"]=>
+ string(5) "file2"
+ ["name"]=>
+ string(9) "file2.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
+ int(0)
+ ["done"]=>
+ bool(true)
+ ["start_time"]=>
+ int(%d)
+ ["bytes_processed"]=>
+ int(1)
+ }
+ }
+}
diff --git a/ext/session/tests/rfc1867_sid_only_cookie.phpt b/ext/session/tests/rfc1867_sid_only_cookie.phpt
index a9206ea1d3..167432a60d 100644
--- a/ext/session/tests/rfc1867_sid_only_cookie.phpt
+++ b/ext/session/tests/rfc1867_sid_only_cookie.phpt
@@ -54,76 +54,76 @@ session_destroy();
string(%d) "rfc1867-tests"
bool(true)
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
array(5) {
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"content_length"]=>
+ ["content_length"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(%d)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"files"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file1"
+ ["name"]=>
+ string(9) "file1.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file2"
+ ["name"]=>
+ string(9) "file2.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["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
index 4c9a9e0211..e56c31e682 100644
--- a/ext/session/tests/rfc1867_sid_only_cookie_2.phpt
+++ b/ext/session/tests/rfc1867_sid_only_cookie_2.phpt
@@ -51,30 +51,30 @@ session_destroy();
string(%d) "%s"
bool(true)
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
diff --git a/ext/session/tests/rfc1867_sid_post.phpt b/ext/session/tests/rfc1867_sid_post.phpt
index a919d9cb7b..858101c3b7 100644
--- a/ext/session/tests/rfc1867_sid_post.phpt
+++ b/ext/session/tests/rfc1867_sid_post.phpt
@@ -50,76 +50,76 @@ session_destroy();
string(%d) "rfc1867-tests"
bool(true)
array(2) {
- [%u|b%"file1"]=>
+ ["file1"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file1.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
- [%u|b%"file2"]=>
+ ["file2"]=>
array(5) {
- [%u|b%"name"]=>
+ ["name"]=>
%string|unicode%(9) "file2.txt"
- [%u|b%"type"]=>
+ ["type"]=>
%string|unicode%(0) ""
- [%u|b%"tmp_name"]=>
+ ["tmp_name"]=>
%string|unicode%(%d) "%s"
- [%u|b%"error"]=>
+ ["error"]=>
int(0)
- [%u|b%"size"]=>
+ ["size"]=>
int(1)
}
}
array(5) {
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"content_length"]=>
+ ["content_length"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(%d)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"files"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file1"
+ ["name"]=>
+ string(9) "file1.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["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"]=>
+ ["field_name"]=>
+ string(5) "file2"
+ ["name"]=>
+ string(9) "file2.txt"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
int(0)
- [%u|b%"done"]=>
+ ["done"]=>
bool(true)
- [%u|b%"start_time"]=>
+ ["start_time"]=>
int(%d)
- [%u|b%"bytes_processed"]=>
+ ["bytes_processed"]=>
int(1)
}
}
diff --git a/ext/session/tests/save_handler.inc b/ext/session/tests/save_handler.inc
index 231109c13c..4d5ac75d03 100644
--- a/ext/session/tests/save_handler.inc
+++ b/ext/session/tests/save_handler.inc
@@ -1,31 +1,77 @@
<?php
DEFINE("SESSION_FILE_PREFIX" ,"session_test_");
+
+/*
+ * == General Return Value Rule ==
+ *
+ * Returning FALSE indicates FATAL error.
+ * Exceptions are: gc(), validate_sid()
+ *
+ * == Session Data Lock ==
+ *
+ * Session data lock is mandatory. Lock must be exclusive. i.e. Block read also.
+ *
+ * == Collision Detection ==
+ *
+ * Collision detection is mandatory to reject attacker initialized session ID.
+ * Coolision detection is absolute requirement for secure session.
+ */
+
+
+/* Open session data database */
function open($save_path, $session_name) {
+ // string $save_path - Directory path, connection strings, etc. Default: session.save_path
+ // string $session_name - Session ID cookie name. Default: session.name
+
global $session_save_path, $name;
$session_save_path = $save_path;
$name = $session_name;
echo "Open [${session_save_path},${session_name}]\n";
+
+ // MUST return bool. Return TRUE for success.
return true;
}
+/* Close session data database */
function close() {
+ // void parameter
+ // NOTE: This function should unlock session data, if write() does not unlock it.
+
global $session_save_path, $name;
echo "Close [${session_save_path},${name}]\n";
+
+ // MUST return bool. Return TRUE for success.
return true;
}
+/* Read session data */
function read($id) {
+ // string $id - Session ID string
+ // NOTE: All production session save handler MUST implement "exclusive" lock.
+ // e.g. Use "serializable transaction isolation level" with RDBMS.
+ // read() would be the best place for locking for most save handlers.
+
global $session_save_path, $name, $session_id;
$session_id = $id;
echo "Read [${session_save_path},${id}]\n";
$session_file = "$session_save_path/".SESSION_FILE_PREFIX.$id;
// read MUST create file. Otherwise, strict mode will not work
touch($session_file);
+
+ // MUST return STRING for successful read().
+ // Return FALSE only when there is error. i.e. Do not return FALSE
+ // for non-existing session data for the $id.
return (string) @file_get_contents($session_file);
}
+/* Write session data */
function write($id, $session_data) {
+ // string $id - Session ID string
+ // string $session_data - Session data string serialized by session serializer.
+ // NOTE: This function may unlock session data locked by read(). If write() is
+ // is not suitable place your handler to unlock. Unlock data at close().
+
global $session_save_path, $name, $session_id;
$session_id = $id;
echo "Write [${session_save_path},${id},${session_data}]\n";
@@ -35,19 +81,32 @@ function write($id, $session_data) {
fclose($fp);
return $return === FALSE ? FALSE : TRUE;
}
+
+ // MUST return bool. Return TRUE for success.
return false;
}
+/* Remove specified session */
function destroy($id) {
+ // string $id - Session ID string
+
global $session_save_path, $name;
echo "Destroy [${session_save_path},${id}]\n";
$session_file = "$session_save_path/".SESSION_FILE_PREFIX.$id;
unlink($session_file);
+
+ // MUST return bool. Return TRUE for success.
+ // Return FALSE only when there is error. i.e. Do not return FALSE
+ // for non-existing session data for the $id.
return true;
}
+/* Perform garbage collection */
function gc($maxlifetime) {
+ // long $maxlifetime - GC TTL in seconds. Default: session.gc_maxlifetime
+
global $session_save_path, $name;
+ $gc_cnt = 0;
$directory = opendir($session_save_path."/");
$length = strlen(SESSION_FILE_PREFIX);
while (($file = readdir($directory)) !== FALSE) {
@@ -55,39 +114,72 @@ function gc($maxlifetime) {
if (is_file($qualified) === TRUE) {
if (substr($file, 0, $length) === SESSION_FILE_PREFIX && (filemtime($qualified) + $maxlifetime <= time() )) {
unlink($qualified);
+ $gc_cnt++;
}
}
}
closedir($directory);
- return true;
+
+ // SHOULD return long (number of deleted sessions).
+ // Returning TRUE works also, but it will not report correct number of deleted sessions.
+ // Return negative value for error. FALSE does not work because it's the same as 0.
+ return $gc_cnt;
}
+/* Create new secure session ID */
function create_sid() {
+ // void parameter
+ // NOTE: Defining create_sid() is mandatory because validate_sid() is mandatory for
+ // security reasons for production save handler.
+ // PHP 7.1 has session_create_id() for secure session ID generation. Older PHPs
+ // must generate secure session ID by yourself.
+ // e.g. hash('sha2', random_bytes(64)) or use /dev/urandom
+
$id = ('PHPT-'.time());
echo "CreateID [${id}]\n";
+
+ // MUST return session ID string.
+ // Return FALSE for error.
return $id;
}
+/* Check session ID collision */
function validate_sid($id) {
+ // string $id - Session ID string
+
global $session_save_path, $name;
echo "ValidateID [${session_save_path},${id}]\n";
$session_file = "$session_save_path/".SESSION_FILE_PREFIX.$id;
$ret = file_exists($session_file);
+
+ // MUST return bool. Return TRUE for collision.
+ // NOTE: This handler is mandatory for session security.
+ // All save handlers MUST implement this handler.
+ // Check session ID collision, return TRUE when it collides.
+ // Otherwise, return FALSE.
return $ret;
}
+/* Update session data access time stamp WITHOUT writing $session_data */
function update($id, $session_data) {
+ // string $id - Session ID string
+ // string $session_data - Session data serialized by session serializer
+ // NOTE: This handler is optional. If your session database cannot
+ // support time stamp updating, you must not define this.
+
global $session_save_path, $name;
echo "Update [${session_save_path},${id}]\n";
$session_file = "$session_save_path/".SESSION_FILE_PREFIX.$id;
$ret = touch($session_file);
+
+ // MUST return bool. Return TRUE for success.
return $ret;
}
function feature() {
/* NOT IMPLEMENTED YET */
- /* TYPES: gc, create_sid, use_strict_mode, minizie_lock, lazy_write
+ /* TYPES: gc, create_sid, use_strict_mode, minimzie_lock, lazy_write
/* VALUES: 0=unknown, 1=supported, 2=partially supported, 3=unsupported */
return array('gc'=>0,
'create_sid'=>1,
diff --git a/ext/session/tests/session_basic1.phpt b/ext/session/tests/session_basic1.phpt
index 8a8f436610..fbce0890c4 100644
--- a/ext/session/tests/session_basic1.phpt
+++ b/ext/session/tests/session_basic1.phpt
@@ -59,12 +59,12 @@ array(1) {
["lazy_write"]=>
bool(false)
}
-NULL
+bool(true)
string(6) "testid"
*** With lazy_write ***
string(6) "testid"
bool(true)
-NULL
+bool(true)
string(6) "testid"
*** Cleanup ***
string(6) "testid"
diff --git a/ext/session/tests/session_basic2.phpt b/ext/session/tests/session_basic2.phpt
index dd992a87a0..1ae44167e8 100644
--- a/ext/session/tests/session_basic2.phpt
+++ b/ext/session/tests/session_basic2.phpt
@@ -64,13 +64,13 @@ string(0) ""
string(6) "testid"
bool(true)
bool(true)
-NULL
+bool(true)
string(32) "%s"
*** With lazy_write ***
string(32) "%s"
bool(true)
bool(true)
-NULL
+bool(true)
string(32) "%s"
*** Cleanup ***
string(32) "%s"
diff --git a/ext/session/tests/session_basic3.phpt b/ext/session/tests/session_basic3.phpt
index 0337151cf0..29bda63edb 100644
--- a/ext/session/tests/session_basic3.phpt
+++ b/ext/session/tests/session_basic3.phpt
@@ -344,7 +344,7 @@ ob_end_flush();
<input type="text" name="test1"></input>
<input type="text" name="test2" />
</form>
-NULL
+bool(true)
*** Cleanup ***
bool(true)
string(6) "testid"
diff --git a/ext/session/tests/session_basic5.phpt b/ext/session/tests/session_basic5.phpt
index 7e3bb7fc21..351c69b41d 100644
--- a/ext/session/tests/session_basic5.phpt
+++ b/ext/session/tests/session_basic5.phpt
@@ -439,7 +439,7 @@ ob_end_flush();
<input type="text" name="test2" />
</form>
-NULL
+bool(true)
*** Cleanup ***
bool(true)
string(6) "testid"
diff --git a/ext/session/tests/session_cache_expire_basic.phpt b/ext/session/tests/session_cache_expire_basic.phpt
index 7166485937..fb240006e7 100644
--- a/ext/session/tests/session_cache_expire_basic.phpt
+++ b/ext/session/tests/session_cache_expire_basic.phpt
@@ -32,6 +32,8 @@ int(180)
int(180)
int(1234567890)
bool(true)
+
+Warning: session_cache_expire(): Cannot change cache expire when session is active in %s on line 17
int(180)
bool(true)
int(180)
diff --git a/ext/session/tests/session_cache_expire_variation1.phpt b/ext/session/tests/session_cache_expire_variation1.phpt
index 9d0ba27fea..1a7324935f 100644
--- a/ext/session/tests/session_cache_expire_variation1.phpt
+++ b/ext/session/tests/session_cache_expire_variation1.phpt
@@ -34,6 +34,8 @@ int(360)
int(360)
int(1234567890)
bool(true)
+
+Warning: session_cache_expire(): Cannot change cache expire when session is active in %s on line 17
int(180)
bool(true)
int(180)
diff --git a/ext/session/tests/session_cache_expire_variation2.phpt b/ext/session/tests/session_cache_expire_variation2.phpt
index f17f4711a9..c3daae6c55 100644
--- a/ext/session/tests/session_cache_expire_variation2.phpt
+++ b/ext/session/tests/session_cache_expire_variation2.phpt
@@ -33,6 +33,8 @@ int(360)
int(360)
int(1234567890)
bool(true)
+
+Warning: session_cache_expire(): Cannot change cache expire when session is active in %s on line 18
int(180)
bool(true)
int(180)
diff --git a/ext/session/tests/session_cache_expire_variation3.phpt b/ext/session/tests/session_cache_expire_variation3.phpt
index c243c1f115..d9f78df491 100644
--- a/ext/session/tests/session_cache_expire_variation3.phpt
+++ b/ext/session/tests/session_cache_expire_variation3.phpt
@@ -38,6 +38,8 @@ string(3) "180"
int(180)
string(10) "1234567890"
bool(true)
+
+Warning: session_cache_expire(): Cannot change cache expire when session is active in %s on line 19
int(1234567890)
string(10) "1234567890"
bool(true)
diff --git a/ext/session/tests/session_cache_limiter_basic.phpt b/ext/session/tests/session_cache_limiter_basic.phpt
index d0531878f0..559a89143c 100644
--- a/ext/session/tests/session_cache_limiter_basic.phpt
+++ b/ext/session/tests/session_cache_limiter_basic.phpt
@@ -15,28 +15,28 @@ ob_start();
echo "*** Testing session_cache_limiter() : basic functionality ***\n";
-var_dump(session_start());
var_dump(session_cache_limiter());
var_dump(session_cache_limiter("public"));
var_dump(session_cache_limiter());
+var_dump(session_start());
var_dump(session_destroy());
-var_dump(session_start());
var_dump(session_cache_limiter());
var_dump(session_cache_limiter("private"));
var_dump(session_cache_limiter());
+var_dump(session_start());
var_dump(session_destroy());
-var_dump(session_start());
var_dump(session_cache_limiter());
var_dump(session_cache_limiter("nocache"));
var_dump(session_cache_limiter());
+var_dump(session_start());
var_dump(session_destroy());
-var_dump(session_start());
var_dump(session_cache_limiter());
var_dump(session_cache_limiter("private_no_expire"));
var_dump(session_cache_limiter());
+var_dump(session_start());
var_dump(session_destroy());
echo "Done";
@@ -44,7 +44,6 @@ ob_end_flush();
?>
--EXPECTF--
*** Testing session_cache_limiter() : basic functionality ***
-bool(true)
string(7) "nocache"
string(7) "nocache"
string(6) "public"
@@ -64,5 +63,5 @@ string(7) "nocache"
string(7) "nocache"
string(17) "private_no_expire"
bool(true)
+bool(true)
Done
-
diff --git a/ext/session/tests/session_cache_limiter_variation1.phpt b/ext/session/tests/session_cache_limiter_variation1.phpt
index 7c6e71eb81..7ba621120d 100644
--- a/ext/session/tests/session_cache_limiter_variation1.phpt
+++ b/ext/session/tests/session_cache_limiter_variation1.phpt
@@ -32,10 +32,15 @@ ob_end_flush();
*** Testing session_cache_limiter() : variation ***
string(7) "nocache"
bool(true)
-string(7) "nocache"
-string(7) "nocache"
-string(6) "public"
+
+Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line 15
+bool(false)
+
+Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line 16
+bool(false)
+
+Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line 17
+bool(false)
bool(true)
-string(6) "public"
+string(7) "nocache"
Done
-
diff --git a/ext/session/tests/session_cache_limiter_variation2.phpt b/ext/session/tests/session_cache_limiter_variation2.phpt
index b6d97a3dda..94571017e1 100644
--- a/ext/session/tests/session_cache_limiter_variation2.phpt
+++ b/ext/session/tests/session_cache_limiter_variation2.phpt
@@ -31,10 +31,15 @@ ob_end_flush();
*** Testing session_cache_limiter() : variation ***
string(7) "nocache"
bool(true)
-string(7) "nocache"
-string(7) "nocache"
-string(6) "public"
+
+Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line 16
+bool(false)
+
+Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line 17
+bool(false)
+
+Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line 18
+bool(false)
bool(true)
-string(6) "public"
+string(7) "nocache"
Done
-
diff --git a/ext/session/tests/session_cache_limiter_variation3.phpt b/ext/session/tests/session_cache_limiter_variation3.phpt
index 7aab95b24e..11d452d46a 100644
--- a/ext/session/tests/session_cache_limiter_variation3.phpt
+++ b/ext/session/tests/session_cache_limiter_variation3.phpt
@@ -31,9 +31,10 @@ ob_end_flush();
string(7) "nocache"
bool(true)
string(7) "nocache"
+
+Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line 16
+bool(false)
string(7) "nocache"
-string(6) "public"
bool(true)
-string(6) "public"
+string(7) "nocache"
Done
-
diff --git a/ext/session/tests/session_commit_basic.phpt b/ext/session/tests/session_commit_basic.phpt
index c20db10933..c72d3ba927 100644
--- a/ext/session/tests/session_commit_basic.phpt
+++ b/ext/session/tests/session_commit_basic.phpt
@@ -32,7 +32,7 @@ ob_end_flush();
bool(true)
array(0) {
}
-NULL
+bool(true)
array(0) {
}
bool(true)
diff --git a/ext/session/tests/session_commit_error.phpt b/ext/session/tests/session_commit_error.phpt
index b867572ebc..79fa72e67b 100644
--- a/ext/session/tests/session_commit_error.phpt
+++ b/ext/session/tests/session_commit_error.phpt
@@ -96,75 +96,122 @@ ob_end_flush();
*** Testing session_commit() : error functionality ***
-- Iteration 1 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 2 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 3 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 4 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 5 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 6 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 7 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 8 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 9 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 10 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 11 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 12 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 13 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 14 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 15 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 16 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 17 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 18 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 19 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 20 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 21 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 22 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 23 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 24 --
+
+Warning: session_commit() expects exactly 0 parameters, 1 given in %s on line 82
NULL
Done
-
diff --git a/ext/session/tests/session_commit_variation1.phpt b/ext/session/tests/session_commit_variation1.phpt
index 81240dac82..a58a562483 100644
--- a/ext/session/tests/session_commit_variation1.phpt
+++ b/ext/session/tests/session_commit_variation1.phpt
@@ -30,12 +30,11 @@ ob_end_flush();
--EXPECTF--
*** Testing session_commit() : variation ***
bool(true)
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
bool(true)
bool(true)
Done
-
diff --git a/ext/session/tests/session_commit_variation2.phpt b/ext/session/tests/session_commit_variation2.phpt
index b38885a8d9..9bde83ce0a 100644
--- a/ext/session/tests/session_commit_variation2.phpt
+++ b/ext/session/tests/session_commit_variation2.phpt
@@ -38,19 +38,19 @@ ob_end_flush();
bool(true)
array(0) {
}
-NULL
+bool(true)
array(0) {
}
bool(true)
array(0) {
}
-NULL
+bool(true)
array(0) {
}
bool(true)
array(0) {
}
-NULL
+bool(true)
array(0) {
}
bool(true)
diff --git a/ext/session/tests/session_commit_variation3.phpt b/ext/session/tests/session_commit_variation3.phpt
index 998e60340f..ed4618a04e 100644
--- a/ext/session/tests/session_commit_variation3.phpt
+++ b/ext/session/tests/session_commit_variation3.phpt
@@ -30,7 +30,7 @@ ob_end_flush();
*** Testing session_commit() : variation ***
array(0) {
}
-NULL
+bool(true)
array(0) {
}
bool(true)
diff --git a/ext/session/tests/session_commit_variation4.phpt b/ext/session/tests/session_commit_variation4.phpt
index fdc4ca5186..fb3ea73058 100644
--- a/ext/session/tests/session_commit_variation4.phpt
+++ b/ext/session/tests/session_commit_variation4.phpt
@@ -45,16 +45,16 @@ string(1) "0"
string(0) ""
bool(true)
string(4) "test"
-NULL
+bool(true)
string(4) "test"
bool(true)
string(1) "0"
string(4) "test"
-NULL
+bool(true)
string(4) "test"
bool(true)
string(4) "test"
-NULL
+bool(true)
string(4) "test"
bool(true)
bool(true)
diff --git a/ext/session/tests/session_commit_variation5.phpt b/ext/session/tests/session_commit_variation5.phpt
index 62bd1c1511..8b3535ba95 100644
--- a/ext/session/tests/session_commit_variation5.phpt
+++ b/ext/session/tests/session_commit_variation5.phpt
@@ -49,19 +49,19 @@ string(0) ""
bool(true)
string(32) "%s"
bool(true)
-NULL
+bool(true)
bool(true)
string(32) "%s"
bool(true)
bool(true)
string(32) "%s"
-NULL
+bool(true)
bool(true)
string(32) "%s"
bool(true)
bool(true)
string(32) "%s"
-NULL
+bool(true)
bool(true)
string(32) "%s"
bool(true)
diff --git a/ext/session/tests/session_encode_error2.phpt b/ext/session/tests/session_encode_error2.phpt
index 3c609226aa..056323ab76 100644
--- a/ext/session/tests/session_encode_error2.phpt
+++ b/ext/session/tests/session_encode_error2.phpt
@@ -220,7 +220,7 @@ bool(true)
-- Iteration 20 --
bool(true)
-bool(false)
+string(33) "Hello World!|s:12:"Hello World!";"
bool(true)
-- Iteration 21 --
diff --git a/ext/session/tests/session_encode_variation1.phpt b/ext/session/tests/session_encode_variation1.phpt
index ce3a921659..26722783db 100644
--- a/ext/session/tests/session_encode_variation1.phpt
+++ b/ext/session/tests/session_encode_variation1.phpt
@@ -35,7 +35,7 @@ Warning: session_encode(): Cannot encode non-existent session in %s on line %d
bool(false)
bool(true)
bool(false)
-NULL
+bool(true)
bool(false)
bool(true)
bool(false)
diff --git a/ext/session/tests/session_get_cookie_params_basic.phpt b/ext/session/tests/session_get_cookie_params_basic.phpt
index e984f556e0..5d328550ea 100644
--- a/ext/session/tests/session_get_cookie_params_basic.phpt
+++ b/ext/session/tests/session_get_cookie_params_basic.phpt
@@ -44,7 +44,7 @@ array(5) {
["httponly"]=>
bool(false)
}
-NULL
+bool(true)
array(5) {
["lifetime"]=>
int(3600)
@@ -57,7 +57,7 @@ array(5) {
["httponly"]=>
bool(false)
}
-NULL
+bool(true)
array(5) {
["lifetime"]=>
int(1234567890)
diff --git a/ext/session/tests/session_ini_set.phpt b/ext/session/tests/session_ini_set.phpt
new file mode 100644
index 0000000000..58c3f837a7
--- /dev/null
+++ b/ext/session/tests/session_ini_set.phpt
@@ -0,0 +1,182 @@
+--TEST--
+Test ini_set() for session : basic functionality
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--INI--
+session.save_path=
+session.name="PHPSESSID"
+session.save_handler="files"
+session.auto_start="0"
+session.gc_probability="1"
+session.gc_divisor="100"
+session.gc_maxlifetime="1440"
+session.serialize_handler="php"
+session.cookie_path="/"
+session.cookie_domain=""
+session.cookie_secure="0"
+session.cookie_httponly="0"
+session.use_cookies="1"
+session.use_only_cookies="1"
+session.use_strict_mode="0"
+session.referer_check=""
+session.cache_limiter="nocache"
+session.cache_expire="180"
+session.use_trans_sid="0"
+session.sid_length="32"
+session.sid_bits_per_character="4"
+session.lazy_write="1"
+--FILE--
+<?php
+ob_start();
+
+/*
+ * Prototype : string ini_set(string $name, string $value)
+ * Description : Set session ini
+ * Source code : ext/session/session.c
+ */
+
+echo "*** Testing ini_set() for session ini: basic functionality ***\n";
+
+var_dump(ini_set("session.save_path", ""));
+var_dump(ini_set("session.name", "PHPSESSID"));
+var_dump(ini_set("session.save_handler", "files"));
+var_dump(ini_set("session.auto_start", "0"));
+var_dump(ini_set("session.gc_probability", "1"));
+var_dump(ini_set("session.gc_divisor", "100"));
+var_dump(ini_set("session.gc_maxlifetime", "1440"));
+var_dump(ini_set("session.serialize_handler", "php"));
+var_dump(ini_set("session.cookie_path", "/"));
+var_dump(ini_set("session.cookie_domain", ""));
+var_dump(ini_set("session.cookie_secure", "0"));
+var_dump(ini_set("session.cookie_httponly", "0"));
+var_dump(ini_set("session.use_cookies", "1"));
+var_dump(ini_set("session.use_only_cookies", "1"));
+var_dump(ini_set("session.use_strict_mode", "0"));
+var_dump(ini_set("session.referer_check", ""));
+var_dump(ini_set("session.cache_limiter", "nocache"));
+var_dump(ini_set("session.cache_expire", "180"));
+var_dump(ini_set("session.use_trans_sid", "0"));
+var_dump(ini_set("session.sid_length", "32"));
+var_dump(ini_set("session.sid_bits_per_character", "4"));
+var_dump(ini_set("session.lazy_write", "1"));
+
+session_start();
+var_dump("session started");
+
+var_dump(ini_set("session.save_path", ""));
+var_dump(ini_set("session.name", "PHPSESSID"));
+var_dump(ini_set("session.save_handler", "files"));
+var_dump(ini_set("session.auto_start", "0"));
+var_dump(ini_set("session.gc_probability", "1"));
+var_dump(ini_set("session.gc_divisor", "100"));
+var_dump(ini_set("session.gc_maxlifetime", "1440"));
+var_dump(ini_set("session.serialize_handler", "php"));
+var_dump(ini_set("session.cookie_path", "/"));
+var_dump(ini_set("session.cookie_domain", ""));
+var_dump(ini_set("session.cookie_secure", "0"));
+var_dump(ini_set("session.cookie_httponly", "0"));
+var_dump(ini_set("session.use_cookies", "1"));
+var_dump(ini_set("session.use_only_cookies", "1"));
+var_dump(ini_set("session.use_strict_mode", "0"));
+var_dump(ini_set("session.referer_check", ""));
+var_dump(ini_set("session.cache_limiter", "nocache"));
+var_dump(ini_set("session.cache_expire", "180"));
+var_dump(ini_set("session.use_trans_sid", "0"));
+var_dump(ini_set("session.sid_length", "32"));
+var_dump(ini_set("session.sid_bits_per_character", "4"));
+var_dump(ini_set("session.lazy_write", "1"));
+
+
+echo "Done";
+ob_end_flush();
+?>
+--EXPECTF--
+*** Testing ini_set() for session ini: basic functionality ***
+string(0) ""
+string(9) "PHPSESSID"
+string(5) "files"
+bool(false)
+string(1) "1"
+string(3) "100"
+string(4) "1440"
+string(3) "php"
+string(1) "/"
+string(0) ""
+string(1) "0"
+string(1) "0"
+string(1) "1"
+string(1) "1"
+string(1) "0"
+string(0) ""
+string(7) "nocache"
+string(3) "180"
+string(1) "0"
+string(2) "32"
+string(1) "4"
+string(1) "1"
+string(15) "session started"
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 38
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 39
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 40
+bool(false)
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 42
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 43
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 44
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 45
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 46
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 47
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 48
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 49
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 50
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 51
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 52
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 53
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 54
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 55
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 56
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 57
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 58
+bool(false)
+
+Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 59
+bool(false)
+Done
diff --git a/ext/session/tests/session_module_name_variation3.phpt b/ext/session/tests/session_module_name_variation3.phpt
index 2660a00fee..09beaa4059 100644
--- a/ext/session/tests/session_module_name_variation3.phpt
+++ b/ext/session/tests/session_module_name_variation3.phpt
@@ -39,14 +39,14 @@ ob_end_flush();
?>
--EXPECTF--
*** Testing session_module_name() : variation ***
-string(%d) "%s"
+string(5) "files"
string(4) "user"
-Warning: Uncaught Exception: Stop...! in %s:%d
+Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line 25
+
+Fatal error: Uncaught Exception: Stop...! in %s:13
Stack trace:
#0 [internal function]: open('', 'PHPSESSID')
-#1 %s(%d): session_start()
+#1 %s(25): session_start()
#2 {main}
- thrown in %s on line %d
-
-Fatal error: session_start(): Failed to initialize storage module: %s in %s%esession_module_name_variation3.php on line %d
+ thrown in %s on line 13
diff --git a/ext/session/tests/session_module_name_variation4.phpt b/ext/session/tests/session_module_name_variation4.phpt
index 0748b3db2f..3fd42e46d7 100644
--- a/ext/session/tests/session_module_name_variation4.phpt
+++ b/ext/session/tests/session_module_name_variation4.phpt
@@ -51,7 +51,7 @@ array(3) {
["Guff"]=>
int(1234567890)
}
-NULL
+bool(true)
array(3) {
["Blah"]=>
string(12) "Hello World!"
diff --git a/ext/session/tests/session_save_path_error.phpt b/ext/session/tests/session_save_path_error.phpt
index 8dd2def8ea..7a2061083a 100644
--- a/ext/session/tests/session_save_path_error.phpt
+++ b/ext/session/tests/session_save_path_error.phpt
@@ -85,7 +85,6 @@ $inputs = array(
/*24*/ $fp
);
-session_start();
$iterator = 1;
foreach($inputs as $input) {
@@ -94,7 +93,6 @@ foreach($inputs as $input) {
$iterator++;
};
-session_destroy();
fclose($fp);
echo "Done";
ob_end_flush();
diff --git a/ext/session/tests/session_save_path_variation1.phpt b/ext/session/tests/session_save_path_variation1.phpt
index 9100fb486f..7f7130dfb0 100644
--- a/ext/session/tests/session_save_path_variation1.phpt
+++ b/ext/session/tests/session_save_path_variation1.phpt
@@ -12,21 +12,25 @@ session.save_handler=files
ob_start();
-/*
+/*
* Prototype : string session_save_path([string $path])
* Description : Get and/or set the current session save path
- * Source code : ext/session/session.c
+ * Source code : ext/session/session.c
*/
echo "*** Testing session_save_path() : variation ***\n";
$directory = dirname(__FILE__);
var_dump(session_save_path());
+var_dump(session_save_path($directory));
+var_dump(session_save_path());
+
var_dump(session_start());
var_dump(session_save_path());
var_dump(session_save_path($directory));
var_dump(session_save_path());
var_dump(session_destroy());
+
var_dump(session_save_path());
echo "Done";
@@ -35,11 +39,18 @@ ob_end_flush();
--EXPECTF--
*** Testing session_save_path() : variation ***
string(0) ""
-bool(true)
-string(0) ""
string(0) ""
-string(%d) "%s"
+string(%d) "%stests"
bool(true)
-string(%d) "%s"
-Done
+Warning: session_save_path(): Cannot change save path when session is active in %s on line 19
+bool(false)
+
+Warning: session_save_path(): Cannot change save path when session is active in %s on line 20
+bool(false)
+
+Warning: session_save_path(): Cannot change save path when session is active in %s on line 21
+bool(false)
+bool(true)
+string(%d) "%stests"
+Done
diff --git a/ext/session/tests/session_save_path_variation4.phpt b/ext/session/tests/session_save_path_variation4.phpt
index a4c4e995d3..8cbee49afb 100644
--- a/ext/session/tests/session_save_path_variation4.phpt
+++ b/ext/session/tests/session_save_path_variation4.phpt
@@ -19,7 +19,7 @@ ob_start();
*/
echo "*** Testing session_save_path() : variation ***\n";
-$initdir = getcwd();
+$initdir = __DIR__;
$sessions = ($initdir."/sessions");
chdir($initdir);
@@ -37,23 +37,30 @@ var_dump(session_start());
var_dump(session_save_path());
var_dump(session_destroy());
var_dump(session_save_path());
-var_dump(rmdir($sessions));
echo "Done";
ob_end_flush();
?>
--CLEAN--
-$initdir = getcwd();
+$initdir = __DIR__;
$sessions = ($initdir."/sessions");
+chdir($initdir);
var_dump(rmdir($sessions));
--EXPECTF--
*** Testing session_save_path() : variation ***
bool(true)
bool(true)
-Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d
+Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line 24
string(0) ""
-Warning: session_start(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d
+Warning: session_start(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line 26
-Fatal error: session_start(): Failed to initialize storage module: files (path: ) in %s on line %d
+Warning: session_start(): Failed to initialize storage module: files (path: ) in %s on line 26
+bool(false)
+string(0) ""
+
+Warning: session_destroy(): Trying to destroy uninitialized session in %s on line 28
+bool(false)
+string(0) ""
+Done
diff --git a/ext/session/tests/session_set_cookie_params_basic.phpt b/ext/session/tests/session_set_cookie_params_basic.phpt
index 5055d1c698..a67aaa2bc4 100644
--- a/ext/session/tests/session_set_cookie_params_basic.phpt
+++ b/ext/session/tests/session_set_cookie_params_basic.phpt
@@ -26,10 +26,11 @@ ob_end_flush();
?>
--EXPECTF--
*** Testing session_set_cookie_params() : basic functionality ***
-NULL
bool(true)
-NULL
bool(true)
-NULL
-Done
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 15
+bool(false)
+bool(true)
+bool(true)
+Done
diff --git a/ext/session/tests/session_set_cookie_params_error.phpt b/ext/session/tests/session_set_cookie_params_error.phpt
index 0dc5310761..9e68ab0359 100644
--- a/ext/session/tests/session_set_cookie_params_error.phpt
+++ b/ext/session/tests/session_set_cookie_params_error.phpt
@@ -100,207 +100,210 @@ ob_end_flush();
*** Testing session_set_cookie_params() : error functionality ***
-- Iteration 1 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 2 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 3 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 4 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+
+Warning: session_set_cookie_params(): CookieLifetime cannot be negative in %s on line 81
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 5 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 6 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+
+Warning: session_set_cookie_params(): CookieLifetime cannot be negative in %s on line 81
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 7 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 8 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 9 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 10 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 11 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 12 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 13 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 14 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 15 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 16 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 17 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 18 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 19 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 20 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 21 --
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
-Warning: session_set_cookie_params() expects parameter 4 to be boolean, object given in %s on line %d
+Warning: session_set_cookie_params() expects parameter 4 to be boolean, object given in %s on line 84
NULL
-Warning: session_set_cookie_params() expects parameter 5 to be boolean, object given in %s on line %d
-NULL
+Warning: session_set_cookie_params() expects parameter 5 to be boolean, object given in %s on line 85
NULL
+bool(true)
-- Iteration 22 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 23 --
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-- Iteration 24 --
-NULL
+bool(true)
-Warning: session_set_cookie_params() expects parameter 2 to be string, resource given in %s on line %d
+Warning: session_set_cookie_params() expects parameter 2 to be string, resource given in %s on line 82
NULL
-Warning: session_set_cookie_params() expects parameter 3 to be string, resource given in %s on line %d
+Warning: session_set_cookie_params() expects parameter 3 to be string, resource given in %s on line 83
NULL
-Warning: session_set_cookie_params() expects parameter 4 to be boolean, resource given in %s on line %d
+Warning: session_set_cookie_params() expects parameter 4 to be boolean, resource given in %s on line 84
NULL
-Warning: session_set_cookie_params() expects parameter 5 to be boolean, resource given in %s on line %d
-NULL
+Warning: session_set_cookie_params() expects parameter 5 to be boolean, resource given in %s on line 85
NULL
+bool(true)
Done
-
diff --git a/ext/session/tests/session_set_cookie_params_variation1.phpt b/ext/session/tests/session_set_cookie_params_variation1.phpt
index 02b901f3cf..93ac056d89 100644
--- a/ext/session/tests/session_set_cookie_params_variation1.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation1.phpt
@@ -20,11 +20,13 @@ echo "*** Testing session_set_cookie_params() : variation ***\n";
var_dump(ini_get("session.cookie_lifetime"));
var_dump(session_set_cookie_params(3600));
var_dump(ini_get("session.cookie_lifetime"));
+
var_dump(session_start());
var_dump(ini_get("session.cookie_lifetime"));
var_dump(session_set_cookie_params(1800));
var_dump(ini_get("session.cookie_lifetime"));
var_dump(session_destroy());
+
var_dump(ini_get("session.cookie_lifetime"));
var_dump(session_set_cookie_params(1234567890));
var_dump(ini_get("session.cookie_lifetime"));
@@ -35,15 +37,16 @@ ob_end_flush();
--EXPECTF--
*** Testing session_set_cookie_params() : variation ***
string(4) "3600"
-NULL
+bool(true)
+string(4) "3600"
+bool(true)
+string(4) "3600"
+
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 19
+bool(false)
string(4) "3600"
bool(true)
string(4) "3600"
-NULL
-string(4) "1800"
bool(true)
-string(4) "1800"
-NULL
string(10) "1234567890"
Done
-
diff --git a/ext/session/tests/session_set_cookie_params_variation2.phpt b/ext/session/tests/session_set_cookie_params_variation2.phpt
index 5d7a01096f..1bf9bae848 100644
--- a/ext/session/tests/session_set_cookie_params_variation2.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation2.phpt
@@ -35,15 +35,16 @@ ob_end_flush();
--EXPECTF--
*** Testing session_set_cookie_params() : variation ***
string(5) "/path"
-NULL
+bool(true)
+string(4) "/foo"
+bool(true)
+string(4) "/foo"
+
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 18
+bool(false)
string(4) "/foo"
bool(true)
string(4) "/foo"
-NULL
-string(5) "/blah"
bool(true)
-string(5) "/blah"
-NULL
string(5) "/guff"
Done
-
diff --git a/ext/session/tests/session_set_cookie_params_variation3.phpt b/ext/session/tests/session_set_cookie_params_variation3.phpt
index 5e8f0ff572..17d1e6a771 100644
--- a/ext/session/tests/session_set_cookie_params_variation3.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation3.phpt
@@ -35,15 +35,16 @@ ob_end_flush();
--EXPECTF--
*** Testing session_set_cookie_params() : variation ***
string(3) "foo"
-NULL
+bool(true)
+string(4) "blah"
+bool(true)
+string(4) "blah"
+
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 18
+bool(false)
string(4) "blah"
bool(true)
string(4) "blah"
-NULL
-string(4) "guff"
bool(true)
-string(4) "guff"
-NULL
string(3) "foo"
Done
-
diff --git a/ext/session/tests/session_set_cookie_params_variation4.phpt b/ext/session/tests/session_set_cookie_params_variation4.phpt
index 7b825968f8..2b10f3cc82 100644
--- a/ext/session/tests/session_set_cookie_params_variation4.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation4.phpt
@@ -35,15 +35,16 @@ ob_end_flush();
--EXPECTF--
*** Testing session_set_cookie_params() : variation ***
string(1) "1"
-NULL
+bool(true)
+string(1) "0"
+bool(true)
+string(1) "0"
+
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 18
+bool(false)
string(1) "0"
bool(true)
string(1) "0"
-NULL
-string(1) "1"
bool(true)
-string(1) "1"
-NULL
string(1) "0"
Done
-
diff --git a/ext/session/tests/session_set_cookie_params_variation5.phpt b/ext/session/tests/session_set_cookie_params_variation5.phpt
index 29559f7fd6..ffdd29db2d 100644
--- a/ext/session/tests/session_set_cookie_params_variation5.phpt
+++ b/ext/session/tests/session_set_cookie_params_variation5.phpt
@@ -35,15 +35,16 @@ ob_end_flush();
--EXPECTF--
*** Testing session_set_cookie_params() : variation ***
string(1) "1"
-NULL
+bool(true)
+string(1) "0"
+bool(true)
+string(1) "0"
+
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 18
+bool(false)
string(1) "0"
bool(true)
string(1) "0"
-NULL
-string(1) "1"
bool(true)
-string(1) "1"
-NULL
string(1) "0"
Done
-
diff --git a/ext/session/tests/session_set_save_handler_class_005.phpt b/ext/session/tests/session_set_save_handler_class_005.phpt
index 1b8c1ce645..b195fc4a53 100644
--- a/ext/session/tests/session_set_save_handler_class_005.phpt
+++ b/ext/session/tests/session_set_save_handler_class_005.phpt
@@ -50,7 +50,7 @@ Warning: SessionHandler::close(): Parent session handler is not open in %ssessio
Warning: session_start(): Failed to read session data: user (%s) in %ssession_set_save_handler_class_005.php on line %d
bool(false)
-string(%d) "%s"
+string(0) ""
string(4) "user"
array(0) {
}
diff --git a/ext/session/tests/session_set_save_handler_class_012.phpt b/ext/session/tests/session_set_save_handler_class_012.phpt
index 0ce03f865e..3671cebe2b 100644
--- a/ext/session/tests/session_set_save_handler_class_012.phpt
+++ b/ext/session/tests/session_set_save_handler_class_012.phpt
@@ -55,7 +55,7 @@ Warning: SessionHandler::close(): Parent session handler is not open in %s on li
Warning: session_start(): Failed to read session data: user (%s) in %s on line %d
bool(false)
-string(%d) "%s"
+string(0) ""
string(5) "files"
string(4) "user"
int(2)
diff --git a/ext/session/tests/session_set_save_handler_class_014.phpt b/ext/session/tests/session_set_save_handler_class_014.phpt
index ea62beb0ff..ba689cef02 100644
--- a/ext/session/tests/session_set_save_handler_class_014.phpt
+++ b/ext/session/tests/session_set_save_handler_class_014.phpt
@@ -3,8 +3,11 @@ Test session_set_save_handler() : calling default handler when save_handler=user
--INI--
session.save_handler=user
session.name=PHPSESSID
+display_errors=off
--SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php
+include('skipif.inc');
+?>
--FILE--
<?php
@@ -25,6 +28,6 @@ session_set_save_handler($handler);
session_start();
--EXPECTF--
+PHP Recoverable fatal error: PHP Startup: Cannot set 'user' save handler by ini_set() or session_module_name() in Unknown on line 0
*** Testing session_set_save_handler() : calling default handler when save_handler=user ***
-Fatal error: SessionHandler::open(): Cannot call default session handler in %s on line %d
diff --git a/ext/session/tests/session_set_save_handler_error3.phpt b/ext/session/tests/session_set_save_handler_error3.phpt
index cefbe811dd..2f2659557b 100644
--- a/ext/session/tests/session_set_save_handler_error3.phpt
+++ b/ext/session/tests/session_set_save_handler_error3.phpt
@@ -35,11 +35,11 @@ ob_end_flush();
--EXPECTF--
*** Testing session_set_save_handler() : error functionality ***
-Warning: Uncaught Exception: Do something bad..! in %s:%d
+Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line 23
+
+Fatal error: Uncaught Exception: Do something bad..! in %s:13
Stack trace:
#0 [internal function]: open('', 'PHPSESSID')
-#1 %s(%d): session_start()
+#1 %s(23): session_start()
#2 {main}
- thrown in %s on line %d
-
-Fatal error: session_start(): Failed to initialize storage module: %s in %ssession_set_save_handler_error3.php on line %d
+ thrown in %s on line 13
diff --git a/ext/session/tests/session_set_save_handler_variation2.phpt b/ext/session/tests/session_set_save_handler_variation2.phpt
index 1c019bb5a6..71f533d93d 100644
--- a/ext/session/tests/session_set_save_handler_variation2.phpt
+++ b/ext/session/tests/session_set_save_handler_variation2.phpt
@@ -28,6 +28,8 @@ ob_end_flush();
*** Testing session_set_save_handler() : variation ***
bool(true)
+
+Warning: session_set_save_handler(): Cannot change save handler when session is active in %s on line 17
bool(false)
bool(true)
diff --git a/ext/session/tests/session_set_save_handler_variation3.phpt b/ext/session/tests/session_set_save_handler_variation3.phpt
index 774d0db489..7ac9834276 100644
--- a/ext/session/tests/session_set_save_handler_variation3.phpt
+++ b/ext/session/tests/session_set_save_handler_variation3.phpt
@@ -19,6 +19,7 @@ echo "*** Testing session_set_save_handler() : variation ***\n";
require_once "save_handler.inc";
$path = dirname(__FILE__);
+var_dump(session_status());
session_save_path($path);
var_dump(session_set_save_handler("open", "close", "read", "write", "destroy", "gc"));
var_dump(session_destroy());
@@ -28,6 +29,10 @@ ob_end_flush();
--EXPECTF--
*** Testing session_set_save_handler() : variation ***
+int(2)
+
+Warning: session_save_path(): Cannot change save path when session is active in %s on line 16
+
+Warning: session_set_save_handler(): Cannot change save handler when session is active in %s on line 17
bool(false)
bool(true)
-
diff --git a/ext/session/tests/session_set_save_handler_variation4.phpt b/ext/session/tests/session_set_save_handler_variation4.phpt
index 0684205694..81af75fd1a 100644
--- a/ext/session/tests/session_set_save_handler_variation4.phpt
+++ b/ext/session/tests/session_set_save_handler_variation4.phpt
@@ -55,7 +55,7 @@ ob_end_flush();
Open [%s,PHPSESSID]
Read [%s,%s]
GC [0]
-1 deleted
+2 deleted
array(3) {
["Blah"]=>
string(12) "Hello World!"
@@ -66,7 +66,7 @@ array(3) {
}
Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;]
Close [%s,PHPSESSID]
-NULL
+bool(true)
Open [%s,PHPSESSID]
Read [%s,%s]
GC [0]
diff --git a/ext/session/tests/session_set_save_handler_variation5.phpt b/ext/session/tests/session_set_save_handler_variation5.phpt
index a8c4f4e09c..c199dc40e3 100644
--- a/ext/session/tests/session_set_save_handler_variation5.phpt
+++ b/ext/session/tests/session_set_save_handler_variation5.phpt
@@ -70,7 +70,7 @@ bool(true)
string(%d) "PHPT-%d"
Write [%s,PHPT-%d,]
Close [%s,PHPSESSID]
-NULL
+bool(true)
string(%d) "PHPT-%d"
*** With lazy_write ***
string(%d) "PHPT-%d"
@@ -83,7 +83,7 @@ GC [0]
bool(true)
Write [%s,PHPT-%d,]
Close [%s,PHPSESSID]
-NULL
+bool(true)
string(%d) "PHPT-%d"
*** Cleanup ***
string(%d) "PHPT-%d"
diff --git a/ext/session/tests/session_start_variation1.phpt b/ext/session/tests/session_start_variation1.phpt
index 1c8f3eb3b8..e7eba3d28b 100644
--- a/ext/session/tests/session_start_variation1.phpt
+++ b/ext/session/tests/session_start_variation1.phpt
@@ -29,16 +29,15 @@ ob_end_flush();
*** Testing session_start() : variation ***
bool(true)
-Notice: A session had already been started - ignoring session_start() in %s on line %d
+Notice: session_start(): A session had already been started - ignoring in %s on line 14
bool(true)
-Notice: A session had already been started - ignoring session_start() in %s on line %d
+Notice: session_start(): A session had already been started - ignoring in %s on line 15
bool(true)
-Notice: A session had already been started - ignoring session_start() in %s on line %d
+Notice: session_start(): A session had already been started - ignoring in %s on line 16
bool(true)
-Notice: A session had already been started - ignoring session_start() in %s on line %d
+Notice: session_start(): A session had already been started - ignoring in %s on line 17
bool(true)
Done
-
diff --git a/ext/session/tests/session_start_variation3.phpt b/ext/session/tests/session_start_variation3.phpt
index e87f84bcea..9ff1ff0139 100644
--- a/ext/session/tests/session_start_variation3.phpt
+++ b/ext/session/tests/session_start_variation3.phpt
@@ -33,17 +33,16 @@ ob_end_flush();
--EXPECTF--
*** Testing session_start() : variation ***
bool(true)
-NULL
bool(true)
-NULL
bool(true)
-NULL
bool(true)
-NULL
bool(true)
-NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
-Warning: session_destroy(): Trying to destroy uninitialized session in %s on line %d
+Warning: session_destroy(): Trying to destroy uninitialized session in %s on line 23
bool(false)
Done
-
diff --git a/ext/session/tests/session_start_variation5.phpt b/ext/session/tests/session_start_variation5.phpt
index 4dcafac330..bbc987e3c8 100644
--- a/ext/session/tests/session_start_variation5.phpt
+++ b/ext/session/tests/session_start_variation5.phpt
@@ -43,7 +43,7 @@ array(4) {
["age"]=>
int(6)
}
-NULL
+bool(true)
array(4) {
["colour"]=>
string(5) "green"
diff --git a/ext/session/tests/session_start_variation6.phpt b/ext/session/tests/session_start_variation6.phpt
index 378554bbe3..56471cc7f3 100644
--- a/ext/session/tests/session_start_variation6.phpt
+++ b/ext/session/tests/session_start_variation6.phpt
@@ -44,7 +44,7 @@ array(4) {
["age"]=>
int(6)
}
-NULL
+bool(true)
array(4) {
["colour"]=>
string(5) "green"
diff --git a/ext/session/tests/session_start_variation9.phpt b/ext/session/tests/session_start_variation9.phpt
index 21523e0657..2629b074b6 100644
--- a/ext/session/tests/session_start_variation9.phpt
+++ b/ext/session/tests/session_start_variation9.phpt
@@ -30,10 +30,9 @@ ob_end_flush();
*** Testing session_start() : variation ***
string(%d) "%s"
-Notice: A session had already been started - ignoring session_start() in %s on line %d
+Notice: session_start(): A session had already been started - ignoring in %s on line 14
bool(true)
string(%d) "%s"
bool(true)
string(0) ""
Done
-
diff --git a/ext/session/tests/session_unset_basic.phpt b/ext/session/tests/session_unset_basic.phpt
index 21b12c4ddc..2e4d3bf5e8 100644
--- a/ext/session/tests/session_unset_basic.phpt
+++ b/ext/session/tests/session_unset_basic.phpt
@@ -33,7 +33,7 @@ array(1) {
["foo"]=>
string(12) "Hello World!"
}
-NULL
+bool(true)
array(0) {
}
bool(true)
diff --git a/ext/session/tests/session_unset_error.phpt b/ext/session/tests/session_unset_error.phpt
index 9478345508..e371bcb409 100644
--- a/ext/session/tests/session_unset_error.phpt
+++ b/ext/session/tests/session_unset_error.phpt
@@ -96,75 +96,122 @@ ob_end_flush();
*** Testing session_unset() : error functionality ***
-- Iteration 1 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 2 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 3 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 4 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 5 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 6 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 7 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 8 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 9 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 10 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 11 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 12 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 13 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 14 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 15 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 16 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 17 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 18 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 19 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 20 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 21 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 22 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 23 --
-bool(false)
+
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
-- Iteration 24 --
-bool(false)
-Done
+Warning: session_unset() expects exactly 0 parameters, 1 given in %s on line 82
+NULL
+Done
diff --git a/ext/session/tests/session_unset_variation1.phpt b/ext/session/tests/session_unset_variation1.phpt
index 17ab283a1b..5c1fc2c701 100644
--- a/ext/session/tests/session_unset_variation1.phpt
+++ b/ext/session/tests/session_unset_variation1.phpt
@@ -32,7 +32,7 @@ ob_end_flush();
*** Testing session_unset() : variation ***
bool(false)
bool(true)
-NULL
+bool(true)
array(1) {
["foo"]=>
string(12) "Hello World!"
diff --git a/ext/session/tests/session_write_close_basic.phpt b/ext/session/tests/session_write_close_basic.phpt
index 0841afed97..5b32f5c266 100644
--- a/ext/session/tests/session_write_close_basic.phpt
+++ b/ext/session/tests/session_write_close_basic.phpt
@@ -32,7 +32,7 @@ ob_end_flush();
bool(true)
array(0) {
}
-NULL
+bool(true)
array(0) {
}
bool(true)
diff --git a/ext/session/tests/session_write_close_error.phpt b/ext/session/tests/session_write_close_error.phpt
index cbdb55f26c..102ac41382 100644
--- a/ext/session/tests/session_write_close_error.phpt
+++ b/ext/session/tests/session_write_close_error.phpt
@@ -96,75 +96,122 @@ ob_end_flush();
*** Testing session_write_close() : error functionality ***
-- Iteration 1 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 2 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 3 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 4 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 5 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 6 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 7 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 8 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 9 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 10 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 11 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 12 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 13 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 14 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 15 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 16 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 17 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 18 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 19 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 20 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 21 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 22 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 23 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
-- Iteration 24 --
+
+Warning: session_write_close() expects exactly 0 parameters, 1 given in %s on line 82
NULL
Done
-
diff --git a/ext/session/tests/session_write_close_variation1.phpt b/ext/session/tests/session_write_close_variation1.phpt
index 595796dbe7..53452b45b9 100644
--- a/ext/session/tests/session_write_close_variation1.phpt
+++ b/ext/session/tests/session_write_close_variation1.phpt
@@ -30,12 +30,11 @@ ob_end_flush();
--EXPECTF--
*** Testing session_write_close() : variation ***
bool(true)
-NULL
-NULL
-NULL
-NULL
-NULL
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
bool(true)
bool(true)
Done
-
diff --git a/ext/session/tests/session_write_close_variation2.phpt b/ext/session/tests/session_write_close_variation2.phpt
index 40871c5cd0..ac4f843cae 100644
--- a/ext/session/tests/session_write_close_variation2.phpt
+++ b/ext/session/tests/session_write_close_variation2.phpt
@@ -38,22 +38,21 @@ ob_end_flush();
bool(true)
array(0) {
}
-NULL
+bool(true)
array(0) {
}
bool(true)
array(0) {
}
-NULL
+bool(true)
array(0) {
}
bool(true)
array(0) {
}
-NULL
+bool(true)
array(0) {
}
bool(true)
bool(true)
Done
-
diff --git a/ext/session/tests/session_write_close_variation3.phpt b/ext/session/tests/session_write_close_variation3.phpt
index 0f8061662c..249b5730df 100644
--- a/ext/session/tests/session_write_close_variation3.phpt
+++ b/ext/session/tests/session_write_close_variation3.phpt
@@ -30,7 +30,7 @@ ob_end_flush();
*** Testing session_write_close() : variation ***
array(0) {
}
-NULL
+bool(true)
array(0) {
}
bool(true)
diff --git a/ext/session/tests/session_write_close_variation4.phpt b/ext/session/tests/session_write_close_variation4.phpt
index 9076dcf4a4..f1a7cb59d9 100644
--- a/ext/session/tests/session_write_close_variation4.phpt
+++ b/ext/session/tests/session_write_close_variation4.phpt
@@ -41,15 +41,15 @@ ob_end_flush();
string(0) ""
bool(true)
string(4) "test"
-NULL
+bool(true)
string(4) "test"
bool(true)
string(4) "test"
-NULL
+bool(true)
string(4) "test"
bool(true)
string(4) "test"
-NULL
+bool(true)
string(4) "test"
bool(true)
bool(true)