summaryrefslogtreecommitdiff
path: root/ext/session/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/session/tests')
-rw-r--r--ext/session/tests/001.phpt14
-rw-r--r--ext/session/tests/003.phpt10
-rw-r--r--ext/session/tests/004.phpt16
-rw-r--r--ext/session/tests/005.phpt41
-rw-r--r--ext/session/tests/006.phpt18
-rw-r--r--ext/session/tests/007.phpt3
-rw-r--r--ext/session/tests/008-php4.2.3.phpt71
-rw-r--r--ext/session/tests/009.phpt3
-rw-r--r--ext/session/tests/010.phpt1
-rw-r--r--ext/session/tests/011.phpt1
-rw-r--r--ext/session/tests/012.phpt8
-rw-r--r--ext/session/tests/013.phpt2
-rw-r--r--ext/session/tests/014.phpt14
-rw-r--r--ext/session/tests/019.phpt14
-rw-r--r--ext/session/tests/bug24592.phpt1
-rw-r--r--ext/session/tests/bug26862.phpt1
16 files changed, 56 insertions, 162 deletions
diff --git a/ext/session/tests/001.phpt b/ext/session/tests/001.phpt
index 19dff78e1f..eb04dc1147 100644
--- a/ext/session/tests/001.phpt
+++ b/ext/session/tests/001.phpt
@@ -5,7 +5,6 @@ session object serialization
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.serialize_handler=php
session.save_handler=files
--FILE--
@@ -24,17 +23,14 @@ $baz->method();
$arr[3] = new foo;
$arr[3]->method();
-session_register("baz");
-session_register("arr");
+session_start();
+
+$_SESSION["baz"] = $baz;
+$_SESSION["arr"] = $arr;
print session_encode()."\n";
session_destroy();
---EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
-
-Deprecated: Function session_register() is deprecated in %s on line %d
-
-Deprecated: Function session_register() is deprecated in %s on line %d
+--EXPECT--
baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}
diff --git a/ext/session/tests/003.phpt b/ext/session/tests/003.phpt
index 8a4e0027f8..03c3b95766 100644
--- a/ext/session/tests/003.phpt
+++ b/ext/session/tests/003.phpt
@@ -5,7 +5,6 @@ session object deserialization
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.serialize_handler=php
session.save_handler=files
--FILE--
@@ -21,14 +20,13 @@ session_id("abtest");
session_start();
session_decode('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;}}');
-$baz->method();
-$arr[3]->method();
+$_SESSION["baz"]->method();
+$_SESSION["arr"][3]->method();
-var_dump($baz);
-var_dump($arr);
+var_dump($_SESSION["baz"]);
+var_dump($_SESSION["arr"]);
session_destroy();
--EXPECT--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
object(foo)#1 (2) {
["bar"]=>
string(2) "ok"
diff --git a/ext/session/tests/004.phpt b/ext/session/tests/004.phpt
index 2ff675e7cd..aeb2c8b363 100644
--- a/ext/session/tests/004.phpt
+++ b/ext/session/tests/004.phpt
@@ -5,7 +5,6 @@ session_set_save_handler test
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.name=PHPSESSID
session.serialize_handler=php
--FILE--
@@ -56,24 +55,23 @@ session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd,
session_id("abtest");
session_start();
-$baz->method();
-$arr[3]->method();
+$_SESSION["baz"]->method();
+$_SESSION["arr"][3]->method();
-var_dump($baz);
-var_dump($arr);
+var_dump($_SESSION["baz"]);
+var_dump($_SESSION["arr"]);
session_write_close();
session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc"));
session_start();
-var_dump($baz);
-var_dump($arr);
+var_dump($_SESSION["baz"]);
+var_dump($_SESSION["arr"]);
session_destroy();
?>
--EXPECT--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
OPEN: PHPSESSID
READ: abtest
object(foo)#2 (2) {
@@ -94,7 +92,7 @@ array(1) {
WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}}
OPEN: PHPSESSID
READ: abtest
-object(foo)#4 (2) {
+object(foo)#3 (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
diff --git a/ext/session/tests/005.phpt b/ext/session/tests/005.phpt
index 124f0a831e..a970e6b71d 100644
--- a/ext/session/tests/005.phpt
+++ b/ext/session/tests/005.phpt
@@ -5,7 +5,6 @@ custom save handler, multiple session_start()s, complex data structure test.
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.name=PHPSESSID
session.serialize_handler=php
--FILE--
@@ -58,37 +57,41 @@ session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd,
session_id("abtest");
session_start();
-$baz->method();
-$arr[3]->method();
+session_decode($hnd->data);
-var_dump($baz);
-var_dump($arr);
+$_SESSION["baz"]->method();
+$_SESSION["arr"][3]->method();
+
+var_dump($_SESSION["baz"]);
+var_dump($_SESSION["arr"]);
session_write_close();
session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc"));
session_start();
-$baz->method();
-$arr[3]->method();
+$_SESSION["baz"]->method();
+$_SESSION["arr"][3]->method();
-$c = 123;
-session_register("c");
-var_dump($baz); var_dump($arr); var_dump($c);
+$_SESSION["c"] = 123;
+var_dump($_SESSION["baz"]);
+var_dump($_SESSION["arr"]);
+var_dump($_SESSION["c"]);
session_write_close();
session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc"));
session_start();
-var_dump($baz); var_dump($arr); var_dump($c);
+var_dump($_SESSION["baz"]);
+var_dump($_SESSION["arr"]);
+var_dump($_SESSION["c"]);
session_destroy();
?>
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
OPEN: PHPSESSID
READ: abtest
-object(foo)#2 (2) {
+object(foo)#4 (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -96,7 +99,7 @@ object(foo)#2 (2) {
}
array(1) {
[3]=>
- object(foo)#3 (2) {
+ object(foo)#2 (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -107,9 +110,7 @@ WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O
CLOSE
OPEN: PHPSESSID
READ: abtest
-
-Deprecated: Function session_register() is deprecated in %s on line %d
-object(foo)#4 (2) {
+object(foo)#2 (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -117,7 +118,7 @@ object(foo)#4 (2) {
}
array(1) {
[3]=>
- object(foo)#2 (2) {
+ object(foo)#4 (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -129,7 +130,7 @@ WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:3;}arr|a:1:{i:3;O
CLOSE
OPEN: PHPSESSID
READ: abtest
-object(foo)#3 (2) {
+object(foo)#4 (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -137,7 +138,7 @@ object(foo)#3 (2) {
}
array(1) {
[3]=>
- object(foo)#4 (2) {
+ object(foo)#2 (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
diff --git a/ext/session/tests/006.phpt b/ext/session/tests/006.phpt
index 7c7af61b73..03fca10381 100644
--- a/ext/session/tests/006.phpt
+++ b/ext/session/tests/006.phpt
@@ -5,7 +5,6 @@ correct instantiation of references between variables in sessions
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.serialize_handler=php
session.save_handler=files
--FILE--
@@ -32,12 +31,11 @@ $b = new b($a);
echo "original values:\n";
var_dump($a,$b);
-session_register("a");
-session_register("b");
+$_SESSION["a"] = $a;
+$_SESSION["b"] = $b;
session_write_close();
-session_unregister("a");
-session_unregister("b");
+unset($_SESSION["a"], $_SESSION["b"]);
session_start();
@@ -45,7 +43,6 @@ echo "values after session:\n";
var_dump($a,$b);
?>
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
original values:
object(a)#%d (1) {
["test"]=>
@@ -58,14 +55,6 @@ object(b)#%d (1) {
string(5) "hallo"
}
}
-
-Deprecated: Function session_register() is deprecated in %s on line %d
-
-Deprecated: Function session_register() is deprecated in %s on line %d
-
-Deprecated: Function session_unregister() is deprecated in %s on line %d
-
-Deprecated: Function session_unregister() is deprecated in %s on line %d
values after session:
object(a)#%d (1) {
["test"]=>
@@ -78,4 +67,3 @@ object(b)#%d (1) {
string(5) "hallo"
}
}
-
diff --git a/ext/session/tests/007.phpt b/ext/session/tests/007.phpt
index 61fd0974e3..d17a1ff16e 100644
--- a/ext/session/tests/007.phpt
+++ b/ext/session/tests/007.phpt
@@ -1,11 +1,10 @@
--TEST--
bug compatibility: unset($c) with enabled register_globals
--SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php include('skipif.inc'); if (PHP_VERSION_ID < 503099) { echo 'requires register_globals'; } ?>
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.bug_compat_42=1
session.serialize_handler=php
session.save_handler=files
diff --git a/ext/session/tests/008-php4.2.3.phpt b/ext/session/tests/008-php4.2.3.phpt
deleted file mode 100644
index 2b712e9bdc..0000000000
--- a/ext/session/tests/008-php4.2.3.phpt
+++ /dev/null
@@ -1,71 +0,0 @@
---TEST--
-bug compatibility: global is used albeit register_globals=0
---SKIPIF--
-<?php include('skipif.inc');
- if (version_compare(PHP_VERSION,"4.2.3-dev", "<")) die("skip this is for PHP >= 4.2.3");
-?>
---INI--
-session.use_cookies=0
-session.cache_limiter=
-register_globals=0
-session.bug_compat_42=1
-session.bug_compat_warn=1
-track_errors=1
-log_errors=0
-html_errors=0
-display_errors=1
-error_reporting=2039;
-session.serialize_handler=php
-session.save_handler=files
-precision=14
---FILE--
-<?php
-session_id("abtest");
-
-### Phase 1 cleanup
-session_start();
-session_destroy();
-
-### Phase 2 $_SESSION["c"] does not contain any value
-session_id("abtest");
-session_register("c");
-var_dump($c);
-unset($c);
-$c = 3.14;
-@session_write_close(); // this generates an E_WARNING which will be printed
-// by $php_errormsg so we can use "@" here. ANY further message IS an error.
-echo $php_errormsg."\n";
-unset($_SESSION);
-unset($c);
-
-### Phase 3 $_SESSION["c"] is set
-session_start();
-var_dump($_SESSION);
-unset($c);
-$c = 2.78;
-
-session_write_close();
-unset($_SESSION);
-unset($c);
-
-### Phase 4 final
-
-session_start();
-var_dump($c);
-var_dump($_SESSION);
-
-session_destroy();
-?>
---EXPECTF--
-NULL
-session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively
-array(1) {
- ["c"]=>
- float(3.14)
-}
-NULL
-array(1) {
- ["c"]=>
- float(3.14)
-}
-
diff --git a/ext/session/tests/009.phpt b/ext/session/tests/009.phpt
index 17aab94a8f..02e6eb17b2 100644
--- a/ext/session/tests/009.phpt
+++ b/ext/session/tests/009.phpt
@@ -1,11 +1,10 @@
--TEST--
-unset($_SESSION["name"]); should work with register_globals=off
+unset($_SESSION["name"]); test
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=0
session.bug_compat_42=1
session.bug_compat_warn=0
session.serialize_handler=php
diff --git a/ext/session/tests/010.phpt b/ext/session/tests/010.phpt
index e1af8ce87f..9ece4e187b 100644
--- a/ext/session/tests/010.phpt
+++ b/ext/session/tests/010.phpt
@@ -5,7 +5,6 @@ $session_array = explode(";", session_encode()); should not segfault
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=0
session.bug_compat_42=1
session.bug_compat_warn=0
--FILE--
diff --git a/ext/session/tests/011.phpt b/ext/session/tests/011.phpt
index 6aaa6bd797..809ee3fd3d 100644
--- a/ext/session/tests/011.phpt
+++ b/ext/session/tests/011.phpt
@@ -5,7 +5,6 @@ session_decode(); should not segfault
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=0
session.bug_compat_42=1
session.bug_compat_warn=0
--FILE--
diff --git a/ext/session/tests/012.phpt b/ext/session/tests/012.phpt
index 32aeb29c11..4746b85be0 100644
--- a/ext/session/tests/012.phpt
+++ b/ext/session/tests/012.phpt
@@ -5,7 +5,6 @@ registering $_SESSION should not segfault
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.bug_compat_42=1
session.bug_compat_warn=0
session.serialize_handler=php
@@ -18,7 +17,7 @@ error_reporting(E_ALL);
session_id("abtest");
session_start();
-session_register("_SESSION");
+$_SESSION["_SESSION"] = Array();
$_SESSION = "kk";
session_write_close();
@@ -31,8 +30,5 @@ session_destroy();
print "I live\n";
?>
---EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
-
-Deprecated: Function session_register() is deprecated in %s on line %d
+--EXPECT--
I live
diff --git a/ext/session/tests/013.phpt b/ext/session/tests/013.phpt
index ad6c14e13e..e67a115604 100644
--- a/ext/session/tests/013.phpt
+++ b/ext/session/tests/013.phpt
@@ -5,7 +5,6 @@ redefining SID should not cause warnings
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.bug_compat_42=1
session.bug_compat_warn=0
session.serialize_handler=php
@@ -24,5 +23,4 @@ session_destroy();
print "I live\n";
?>
--EXPECT--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
I live
diff --git a/ext/session/tests/014.phpt b/ext/session/tests/014.phpt
index 4e77a7aeff..0c32dce510 100644
--- a/ext/session/tests/014.phpt
+++ b/ext/session/tests/014.phpt
@@ -3,10 +3,9 @@ a script should not be able to modify session.use_trans_sid
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
-session.use_trans_sid=1
+session.use_trans_sid=0
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.bug_compat_42=1
session.bug_compat_warn=0
session.name=PHPSESSID
@@ -22,22 +21,21 @@ session_start();
?>
<a href="/link">
<?php
-ini_set("session.use_trans_sid","0");
+ini_set("session.use_trans_sid","1");
?>
<a href="/link">
<?php
-ini_set("session.use_trans_sid","1");
+ini_set("session.use_trans_sid","0");
?>
<a href="/link">
<?php
session_destroy();
?>
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
-<a href="/link?PHPSESSID=abtest">
+<a href="/link">
Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line %d
-<a href="/link?PHPSESSID=abtest">
+<a href="/link">
Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line %d
-<a href="/link?PHPSESSID=abtest">
+<a href="/link">
diff --git a/ext/session/tests/019.phpt b/ext/session/tests/019.phpt
index 5bdd03b5cf..e0b8256a59 100644
--- a/ext/session/tests/019.phpt
+++ b/ext/session/tests/019.phpt
@@ -5,7 +5,6 @@ serializing references test case using globals
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.serialize_handler=php
session.save_handler=files
--FILE--
@@ -27,27 +26,26 @@ session_id("abtest");
session_start();
session_register('o1', 'o2' );
-$o1 = new TFoo(42);
-$o2 =& $o1;
+$_SESSION["o1"] = new TFoo(42);
+$_SESSION["o2"] =& $_SESSION["o1"];
session_write_close();
-unset($o1);
-unset($o2);
+unset($_SESSION["o1"]);
+unset($_SESSION["o2"]);
session_start();
var_dump($_SESSION);
-$o1->inc();
-$o2->inc();
+$_SESSION["o1"]->inc();
+$_SESSION["o2"]->inc();
var_dump($_SESSION);
session_destroy();
?>
--EXPECTF--
-Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Deprecated: Function session_register() is deprecated in %s on line %d
array(2) {
diff --git a/ext/session/tests/bug24592.phpt b/ext/session/tests/bug24592.phpt
index 059125ba2e..9f6c395317 100644
--- a/ext/session/tests/bug24592.phpt
+++ b/ext/session/tests/bug24592.phpt
@@ -3,7 +3,6 @@ Bug #24592 (crash when multiple NULL values are being stored)
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
-register_globals=0
html_errors=0
session.save_handler=files
--FILE--
diff --git a/ext/session/tests/bug26862.phpt b/ext/session/tests/bug26862.phpt
index 44e7418cd0..7990f74359 100644
--- a/ext/session/tests/bug26862.phpt
+++ b/ext/session/tests/bug26862.phpt
@@ -3,7 +3,6 @@ Bug #26862 (ob_flush() before output_reset_rewrite_vars() results in data loss)
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
-register_globals=0
html_errors=0
session.use_trans_sid=0
session.save_handler=files