diff options
Diffstat (limited to 'ext/session/tests')
-rw-r--r-- | ext/session/tests/001.phpt | 35 | ||||
-rw-r--r-- | ext/session/tests/002.phpt | 13 | ||||
-rw-r--r-- | ext/session/tests/003.phpt | 44 | ||||
-rw-r--r-- | ext/session/tests/004.phpt | 111 | ||||
-rw-r--r-- | ext/session/tests/005.phpt | 146 | ||||
-rw-r--r-- | ext/session/tests/006.phpt | 70 | ||||
-rw-r--r-- | ext/session/tests/007.phpt | 59 | ||||
-rw-r--r-- | ext/session/tests/008-php4.2.3.phpt | 68 | ||||
-rw-r--r-- | ext/session/tests/008.phpt | 61 | ||||
-rw-r--r-- | ext/session/tests/009.phpt | 57 | ||||
-rw-r--r-- | ext/session/tests/010.phpt | 19 | ||||
-rw-r--r-- | ext/session/tests/011.phpt | 20 | ||||
-rw-r--r-- | ext/session/tests/012.phpt | 34 | ||||
-rw-r--r-- | ext/session/tests/013.phpt | 26 | ||||
-rw-r--r-- | ext/session/tests/014.phpt | 41 | ||||
-rw-r--r-- | ext/session/tests/015.phpt | 24 | ||||
-rw-r--r-- | ext/session/tests/016.phpt | 21 | ||||
-rw-r--r-- | ext/session/tests/017.phpt | 25 | ||||
-rw-r--r-- | ext/session/tests/018.phpt | 24 | ||||
-rw-r--r-- | ext/session/tests/019.phpt | 72 | ||||
-rw-r--r-- | ext/session/tests/020.phpt | 25 | ||||
-rw-r--r-- | ext/session/tests/021.phpt | 61 | ||||
-rw-r--r-- | ext/session/tests/bug24592.phpt | 35 | ||||
-rw-r--r-- | ext/session/tests/skipif.inc | 13 |
24 files changed, 0 insertions, 1104 deletions
diff --git a/ext/session/tests/001.phpt b/ext/session/tests/001.phpt deleted file mode 100644 index 54918b5799..0000000000 --- a/ext/session/tests/001.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -session object serialization ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.serialize_handler=php ---FILE-- -<?php -error_reporting(E_ALL); - -class foo { - public $bar = "ok"; - - function method() { $this->yes = "done"; } -} - -$baz = new foo; -$baz->method(); - -$arr[3] = new foo; -$arr[3]->method(); - -session_register("baz"); -session_register("arr"); - -print session_encode()."\n"; - -session_destroy(); ---GET-- ---POST-- ---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/002.phpt b/ext/session/tests/002.phpt deleted file mode 100644 index 7c77fdcf94..0000000000 --- a/ext/session/tests/002.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -session_unset() without a initialized session ---SKIPIF-- -<?php include('skipif.inc'); ?> ---FILE-- -<?php -error_reporting(E_ALL); -session_unset(); -print "ok\n"; ---GET-- ---POST-- ---EXPECT-- -ok diff --git a/ext/session/tests/003.phpt b/ext/session/tests/003.phpt deleted file mode 100644 index fed90902cd..0000000000 --- a/ext/session/tests/003.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -session object deserialization ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.serialize_handler=php ---FILE-- -<?php -error_reporting(E_ALL); - -class foo { - public $bar = "ok"; - function method() { $this->yes++; } -} - -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(); - -var_dump($baz); -var_dump($arr); -session_destroy(); ---EXPECT-- -object(foo)#1 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) -} -array(1) { - [3]=> - object(foo)#2 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) - } -} diff --git a/ext/session/tests/004.phpt b/ext/session/tests/004.phpt deleted file mode 100644 index 2040476bc0..0000000000 --- a/ext/session/tests/004.phpt +++ /dev/null @@ -1,111 +0,0 @@ ---TEST-- -session_set_save_handler test ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.name=PHPSESSID -session.serialize_handler=php ---FILE-- -<?php -error_reporting(E_ALL); - -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;}}'; - function open($save_path, $session_name) - { - print "OPEN: $session_name\n"; - return true; - } - function close() - { - return true; - } - function read($key) - { - print "READ: $key\n"; - return $GLOBALS["hnd"]->data; - } - - function write($key, $val) - { - print "WRITE: $key, $val\n"; - $GLOBALS["hnd"]->data = $val; - return true; - } - - function destroy($key) - { - print "DESTROY: $key\n"; - return true; - } - - function gc() { return true; } -} - -$hnd = new handler; - -class foo { - public $bar = "ok"; - function method() { $this->yes++; } -} - -session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc")); - -session_id("abtest"); -session_start(); -$baz->method(); -$arr[3]->method(); - -var_dump($baz); -var_dump($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); - -session_destroy(); -?> ---EXPECT-- -OPEN: PHPSESSID -READ: abtest -object(foo)#2 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) -} -array(1) { - [3]=> - object(foo)#3 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) - } -} -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) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) -} -array(1) { - [3]=> - object(foo)#2 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) - } -} -DESTROY: abtest diff --git a/ext/session/tests/005.phpt b/ext/session/tests/005.phpt deleted file mode 100644 index 5638376b9d..0000000000 --- a/ext/session/tests/005.phpt +++ /dev/null @@ -1,146 +0,0 @@ ---TEST-- -custom save handler, multiple session_start()s, complex data structure test. ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.name=PHPSESSID -session.serialize_handler=php ---FILE-- -<?php - -error_reporting(E_ALL); - -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;}}'; - function open($save_path, $session_name) - { - print "OPEN: $session_name\n"; - return true; - } - function close() - { - print "CLOSE\n"; - return true; - } - function read($key) - { - print "READ: $key\n"; - return $GLOBALS["hnd"]->data; - } - - function write($key, $val) - { - print "WRITE: $key, $val\n"; - $GLOBALS["hnd"]->data = $val; - return true; - } - - function destroy($key) - { - print "DESTROY: $key\n"; - return true; - } - - function gc() { return true; } -} - -$hnd = new handler; - -class foo { - public $bar = "ok"; - function method() { $this->yes++; } -} - -session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc")); - -session_id("abtest"); -session_start(); -$baz->method(); -$arr[3]->method(); - -var_dump($baz); -var_dump($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(); - - -$c = 123; -session_register("c"); -var_dump($baz); var_dump($arr); var_dump($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); - -session_destroy(); -?> ---EXPECT-- -OPEN: PHPSESSID -READ: abtest -object(foo)#2 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) -} -array(1) { - [3]=> - object(foo)#3 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(2) - } -} -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;}} -CLOSE -OPEN: PHPSESSID -READ: abtest -object(foo)#4 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(3) -} -array(1) { - [3]=> - object(foo)#2 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(3) - } -} -int(123) -WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:3;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:3;}}c|i:123; -CLOSE -OPEN: PHPSESSID -READ: abtest -object(foo)#3 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(3) -} -array(1) { - [3]=> - object(foo)#4 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - int(3) - } -} -int(123) -DESTROY: abtest -CLOSE diff --git a/ext/session/tests/006.phpt b/ext/session/tests/006.phpt deleted file mode 100644 index fb355976fb..0000000000 --- a/ext/session/tests/006.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -correct instantiation of references between variables in sessions ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.serialize_handler=php ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); - -class a { - public $test = "hallo"; -} - -class b { - public $a; - function b(&$a) { - $this->a = &$a; - } -} - -$a = new a(); -$b = new b($a); - -echo "original values:\n"; -var_dump($a,$b); - -session_register("a"); -session_register("b"); -session_write_close(); - -session_unregister("a"); -session_unregister("b"); - -session_start(); - -echo "values after session:\n"; -var_dump($a,$b); -?> ---EXPECTF-- -original values: -object(a)#%d (1) { - ["test"]=> - string(5) "hallo" -} -object(b)#%d (1) { - ["a"]=> - &object(a)#%d (1) { - ["test"]=> - string(5) "hallo" - } -} -values after session: -object(a)#%d (1) { - ["test"]=> - string(5) "hallo" -} -object(b)#%d (1) { - ["a"]=> - &object(a)#%d (1) { - ["test"]=> - string(5) "hallo" - } -}
\ No newline at end of file diff --git a/ext/session/tests/007.phpt b/ext/session/tests/007.phpt deleted file mode 100644 index 7e13ab27e3..0000000000 --- a/ext/session/tests/007.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -bug compatibility: unset($c) with enabled register_globals ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.bug_compat_42=1 -session.serialize_handler=php ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); - -### Phase 1 cleanup -session_start(); -session_destroy(); - -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value -session_id("abtest"); -session_register("c"); -unset($c); -$c = 3.14; -session_write_close(); -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 3 $HTTP_SESSION_VARS["c"] is set -session_start(); -var_dump($c); -var_dump($HTTP_SESSION_VARS); -unset($c); -$c = 2.78; - -session_write_close(); -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 4 final - -session_start(); -var_dump($c); -var_dump($HTTP_SESSION_VARS); - -session_destroy(); -?> ---EXPECT-- -float(3.14) -array(1) { - ["c"]=> - &float(3.14) -} -float(3.14) -array(1) { - ["c"]=> - &float(3.14) -} 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 2785ddc2e8..0000000000 --- a/ext/session/tests/008-php4.2.3.phpt +++ /dev/null @@ -1,68 +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 ---FILE-- -<?php -session_id("abtest"); - -### Phase 1 cleanup -session_start(); -session_destroy(); - -### Phase 2 $HTTP_SESSION_VARS["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($HTTP_SESSION_VARS); -unset($c); - -### Phase 3 $HTTP_SESSION_VARS["c"] is set -session_start(); -var_dump($HTTP_SESSION_VARS); -unset($c); -$c = 2.78; - -session_write_close(); -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 4 final - -session_start(); -var_dump($c); -var_dump($HTTP_SESSION_VARS); - -session_destroy(); -?> ---EXPECTF-- -NULL -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/008.phpt b/ext/session/tests/008.phpt deleted file mode 100644 index 044a6f2536..0000000000 --- a/ext/session/tests/008.phpt +++ /dev/null @@ -1,61 +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=0 ---FILE-- -<?php -error_reporting(E_ALL & ~E_NOTICE); - -session_id("abtest"); - -### Phase 1 cleanup -session_start(); -session_destroy(); - -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value -session_id("abtest"); -session_register("c"); -var_dump($c); -unset($c); -$c = 3.14; -session_write_close(); -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 3 $HTTP_SESSION_VARS["c"] is set -session_start(); -var_dump($HTTP_SESSION_VARS); -unset($c); -$c = 2.78; - -session_write_close(); -unset($HTTP_SESSION_VARS); -unset($c); - -### Phase 4 final - -session_start(); -var_dump($c); -var_dump($HTTP_SESSION_VARS); - -session_destroy(); -?> ---EXPECT-- -NULL -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 deleted file mode 100644 index a79cb931aa..0000000000 --- a/ext/session/tests/009.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -unset($_SESSION["name"]); should work with register_globals=off ---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 ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); - -### Phase 1 cleanup -session_start(); -session_destroy(); - -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value -session_id("abtest"); -session_start(); -var_dump($HTTP_SESSION_VARS); -$HTTP_SESSION_VARS["name"] = "foo"; -var_dump($HTTP_SESSION_VARS); -session_write_close(); - -### Phase 3 $HTTP_SESSION_VARS["c"] is set -session_start(); -var_dump($HTTP_SESSION_VARS); -unset($HTTP_SESSION_VARS["name"]); -var_dump($HTTP_SESSION_VARS); -session_write_close(); - -### Phase 4 final - -session_start(); -var_dump($HTTP_SESSION_VARS); -session_destroy(); -?> ---EXPECT-- -array(0) { -} -array(1) { - ["name"]=> - string(3) "foo" -} -array(1) { - ["name"]=> - string(3) "foo" -} -array(0) { -} -array(0) { -} diff --git a/ext/session/tests/010.phpt b/ext/session/tests/010.phpt deleted file mode 100644 index e1af8ce87f..0000000000 --- a/ext/session/tests/010.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -$session_array = explode(";", session_encode()); should not segfault ---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 ---FILE-- -<?php -error_reporting(E_ALL); - -$session_array = explode(";", @session_encode()); -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/011.phpt b/ext/session/tests/011.phpt deleted file mode 100644 index 6aaa6bd797..0000000000 --- a/ext/session/tests/011.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -session_decode(); should not segfault ---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 ---FILE-- -<?php -error_reporting(E_ALL); - -@session_decode("garbage data and no session started"); -@session_decode("userid|s:5:\"mazen\";chatRoom|s:1:\"1\";"); -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/012.phpt b/ext/session/tests/012.phpt deleted file mode 100644 index 2bfee9b3de..0000000000 --- a/ext/session/tests/012.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -registering $_SESSION should not segfault ---SKIPIF-- -<?php include('skipif.inc'); ?> ---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 ---FILE-- -<?php -error_reporting(E_ALL); - -### Absurd example, value of $_SESSION does not matter - -session_id("abtest"); -session_start(); -session_register("_SESSION"); -$_SESSION = "kk"; - -session_write_close(); - -### Restart to test for $_SESSION brokenness - -session_start(); -$_SESSION = "kk"; -session_destroy(); - -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/013.phpt b/ext/session/tests/013.phpt deleted file mode 100644 index 77c1353054..0000000000 --- a/ext/session/tests/013.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -redefining SID should not cause warnings ---SKIPIF-- -<?php include('skipif.inc'); ?> ---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 ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); -session_destroy(); -session_id("abtest2"); -session_start(); -session_destroy(); - -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/014.phpt b/ext/session/tests/014.phpt deleted file mode 100644 index 3f22186839..0000000000 --- a/ext/session/tests/014.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -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_cookies=0 -session.cache_limiter= -register_globals=1 -session.bug_compat_42=1 -session.bug_compat_warn=0 -session.name=PHPSESSID -session.serialize_handler=php ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); - -?> -<a href="/link"> -<?php -ini_set("session.use_trans_sid","0"); -?> -<a href="/link"> -<?php -ini_set("session.use_trans_sid","1"); -?> -<a href="/link"> -<?php -session_destroy(); -?> ---EXPECTF-- -<a href="/link?PHPSESSID=abtest"> - -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"> - -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"> diff --git a/ext/session/tests/015.phpt b/ext/session/tests/015.phpt deleted file mode 100644 index 53929b1672..0000000000 --- a/ext/session/tests/015.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -use_trans_sid should not affect SID ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_trans_sid=1 -session.use_cookies=0 -session.cache_limiter= -arg_separator.output=& -session.name=PHPSESSID -session.serialize_handler=php ---FILE-- -<?php -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); -?> -<a href="/link?<?php echo SID; ?>"> -<?php -session_destroy(); -?> ---EXPECT-- -<a href="/link?PHPSESSID=abtest&PHPSESSID=abtest"> diff --git a/ext/session/tests/016.phpt b/ext/session/tests/016.phpt deleted file mode 100644 index 21cd0ec929..0000000000 --- a/ext/session/tests/016.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -invalid session.save_path should not cause a segfault ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.save_path="123;:/really\\completely:::/invalid;;,23123;213" -session.use_cookies=0 -session.cache_limiter= -session.save_handler=files -session.serialize_handler=php ---FILE-- -<?php -error_reporting(E_ALL); - -@session_start(); -$HTTP_SESSION_VARS["test"] = 1; -@session_write_close(); -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/017.phpt b/ext/session/tests/017.phpt deleted file mode 100644 index 2a11fed85b..0000000000 --- a/ext/session/tests/017.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -setting $_SESSION before session_start() should not cause segfault ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.serialize_handler=php ---FILE-- -<?php - -error_reporting(E_ALL); - -class Kill { - function Kill() { - global $HTTP_SESSION_VARS; - session_start(); - } -} -$k = new Kill(); - -print "I live\n"; -?> ---EXPECT-- -I live diff --git a/ext/session/tests/018.phpt b/ext/session/tests/018.phpt deleted file mode 100644 index 0b84978ed2..0000000000 --- a/ext/session/tests/018.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -rewriter correctly handles attribute names which contain dashes ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.use_trans_sid=1 -session.name=PHPSESSID -session.serialize_handler=php ---FILE-- -<?php - -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); -?> -<form accept-charset="ISO-8859-15, ISO-8859-1" action=url.php> -<?php -session_destroy(); -?> ---EXPECT-- -<form accept-charset="ISO-8859-15, ISO-8859-1" action=url.php><input type="hidden" name="PHPSESSID" value="abtest" /> diff --git a/ext/session/tests/019.phpt b/ext/session/tests/019.phpt deleted file mode 100644 index c890088a31..0000000000 --- a/ext/session/tests/019.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -serializing references test case using globals ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -register_globals=1 -session.serialize_handler=php ---FILE-- -<?php - -error_reporting(E_ALL); - -class TFoo { - public $c; - function TFoo($c) { - $this->c = $c; - } - function inc() { - $this->c++; - } -} - -session_id("abtest"); -session_start(); -session_register('o1', 'o2' ); - -$o1 =& new TFoo(42); -$o2 =& $o1; - -session_write_close(); - -unset($o1); -unset($o2); - -session_start(); - -var_dump($_SESSION); - -$o1->inc(); -$o2->inc(); - -var_dump($_SESSION); - -session_destroy(); -?> ---EXPECTF-- -array(2) { - ["o1"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(42) - } - ["o2"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(42) - } -} -array(2) { - ["o1"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(44) - } - ["o2"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(44) - } -} diff --git a/ext/session/tests/020.phpt b/ext/session/tests/020.phpt deleted file mode 100644 index c9571ef20d..0000000000 --- a/ext/session/tests/020.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -rewriter uses arg_seperator.output for modifying URLs ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.use_trans_sid=1 -arg_separator.output=& -session.name=PHPSESSID -session.serialize_handler=php ---FILE-- -<?php - -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); -?> -<a href="link.php?a=b"> -<?php -session_destroy(); -?> ---EXPECT-- -<a href="link.php?a=b&PHPSESSID=abtest"> diff --git a/ext/session/tests/021.phpt b/ext/session/tests/021.phpt deleted file mode 100644 index b45406438e..0000000000 --- a/ext/session/tests/021.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -rewriter handles form and fieldset tags correctly ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.use_trans_sid=1 -url_rewriter.tags="a=href,area=href,frame=src,input=src,form=,fieldset=" -session.name=PHPSESSID -session.serialize_handler=php ---FILE-- -<?php - -error_reporting(E_ALL); - -session_id("abtest"); -session_start(); -?> -<form> -<fieldset> -<?php - -ob_flush(); - -ini_set("url_rewriter.tags", "a=href,area=href,frame=src,input=src,form="); - -?> -<form> -<fieldset> -<?php - -ob_flush(); - -ini_set("url_rewriter.tags", "a=href,area=href,frame=src,input=src,form=fakeentry"); - -?> -<form> -<fieldset> -<?php - -ob_flush(); - -ini_set("url_rewriter.tags", "a=href,fieldset=,area=href,frame=src,input=src"); - -?> -<form> -<fieldset> -<?php - -session_destroy(); -?> ---EXPECT-- -<form><input type="hidden" name="PHPSESSID" value="abtest" /> -<fieldset><input type="hidden" name="PHPSESSID" value="abtest" /> -<form><input type="hidden" name="PHPSESSID" value="abtest" /> -<fieldset> -<form><input type="hidden" name="PHPSESSID" value="abtest" /> -<fieldset> -<form> -<fieldset><input type="hidden" name="PHPSESSID" value="abtest" /> diff --git a/ext/session/tests/bug24592.phpt b/ext/session/tests/bug24592.phpt deleted file mode 100644 index e13c89a5f0..0000000000 --- a/ext/session/tests/bug24592.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #24592 (crash when multiple NULL values are being stored) ---SKIPIF-- -<?php include('skipif.inc'); ?> ---INI-- -register_globals=0 -html_errors=0 ---FILE-- -<?php -@session_start(); - -$foo = $_SESSION['foo']; -$bar = $_SESSION['bar']; - -var_dump($foo, $bar, $_SESSION); - -$_SESSION['foo'] = $foo; -$_SESSION['bar'] = $bar; - -var_dump($_SESSION); -?> ---EXPECTF-- -Notice: Undefined index: foo in %s on line %d - -Notice: Undefined index: bar in %s on line %d -NULL -NULL -array(0) { -} -array(2) { - ["foo"]=> - NULL - ["bar"]=> - NULL -} diff --git a/ext/session/tests/skipif.inc b/ext/session/tests/skipif.inc deleted file mode 100644 index 84caea38b4..0000000000 --- a/ext/session/tests/skipif.inc +++ /dev/null @@ -1,13 +0,0 @@ -<?php -// This script prints "skip" if condition does not meet. -if (!extension_loaded("session") && ini_get("enable_dl")) { - $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so"; - @dl("session$dlext"); -} -if (!extension_loaded("session")) { - die("skip Session module not loaded"); -} -if (!file_exists(ini_get("session.save_path"))) { - die("skip Session save_path doesn't exist"); -} -?> |