summaryrefslogtreecommitdiff
path: root/ext/session/tests
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2013-08-21 08:08:55 +0900
committerYasuo Ohgaki <yohgaki@php.net>2013-08-21 08:12:11 +0900
commitd2a99a7c315beba3fcecd5c4a47d6ce1d1a78283 (patch)
tree99920f5681c0c09e23cdd79415a533bad65016c6 /ext/session/tests
parent89c4abab2b83dd52f71e2915aca35e86c4f81583 (diff)
downloadphp-git-d2a99a7c315beba3fcecd5c4a47d6ce1d1a78283.tar.gz
Fixed Bug #65475
Diffstat (limited to 'ext/session/tests')
-rw-r--r--ext/session/tests/bug65475.phpt34
-rw-r--r--ext/session/tests/rfc1867.phpt1
-rw-r--r--ext/session/tests/rfc1867_cleanup.phpt1
-rw-r--r--ext/session/tests/rfc1867_disabled.phpt1
-rw-r--r--ext/session/tests/rfc1867_disabled_2.phpt1
-rw-r--r--ext/session/tests/rfc1867_inter.phpt1
-rw-r--r--ext/session/tests/rfc1867_no_name.phpt1
-rw-r--r--ext/session/tests/rfc1867_sid_cookie.phpt1
-rw-r--r--ext/session/tests/rfc1867_sid_get.phpt1
-rw-r--r--ext/session/tests/rfc1867_sid_get_2.phpt1
-rw-r--r--ext/session/tests/rfc1867_sid_only_cookie.phpt1
-rw-r--r--ext/session/tests/rfc1867_sid_post.phpt1
-rw-r--r--ext/session/tests/session_id_basic.phpt2
13 files changed, 47 insertions, 0 deletions
diff --git a/ext/session/tests/bug65475.phpt b/ext/session/tests/bug65475.phpt
new file mode 100644
index 0000000000..7dc5463879
--- /dev/null
+++ b/ext/session/tests/bug65475.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #65475: Session ID is not initialized when session.usr_strict_mode=1
+--INI--
+session.save_handler=files
+session.name=PHPSESSID
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+ob_start();
+
+echo "Testing file module".PHP_EOL;
+session_start();
+$_SESSION['foo'] = 1234;
+$_SESSION['cnt'] = 1;
+$session_id = session_id();
+session_write_close();
+
+session_start();
+var_dump($session_id === session_id());
+$_SESSION['cnt']++;
+session_write_close();
+
+session_start();
+var_dump($session_id === session_id());
+var_dump($_SESSION['cnt']); // Should be int(2)
+session_write_close();
+
+--EXPECTF--
+Testing file module
+bool(true)
+bool(true)
+int(2)
+
diff --git a/ext/session/tests/rfc1867.phpt b/ext/session/tests/rfc1867.phpt
index dc44e8b443..6b14bcb4ef 100644
--- a/ext/session/tests/rfc1867.phpt
+++ b/ext/session/tests/rfc1867.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=0
session.upload_progress.enabled=1
diff --git a/ext/session/tests/rfc1867_cleanup.phpt b/ext/session/tests/rfc1867_cleanup.phpt
index f70b395d22..f84385bada 100644
--- a/ext/session/tests/rfc1867_cleanup.phpt
+++ b/ext/session/tests/rfc1867_cleanup.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=0
session.upload_progress.enabled=1
diff --git a/ext/session/tests/rfc1867_disabled.phpt b/ext/session/tests/rfc1867_disabled.phpt
index 4490055791..550ee3a7a2 100644
--- a/ext/session/tests/rfc1867_disabled.phpt
+++ b/ext/session/tests/rfc1867_disabled.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=0
session.upload_progress.enabled=0
diff --git a/ext/session/tests/rfc1867_disabled_2.phpt b/ext/session/tests/rfc1867_disabled_2.phpt
index e878f4619f..83e97eeed1 100644
--- a/ext/session/tests/rfc1867_disabled_2.phpt
+++ b/ext/session/tests/rfc1867_disabled_2.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=0
session.upload_progress.enabled=1
diff --git a/ext/session/tests/rfc1867_inter.phpt b/ext/session/tests/rfc1867_inter.phpt
index 768637105c..4d9b262230 100644
--- a/ext/session/tests/rfc1867_inter.phpt
+++ b/ext/session/tests/rfc1867_inter.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=0
session.upload_progress.enabled=1
diff --git a/ext/session/tests/rfc1867_no_name.phpt b/ext/session/tests/rfc1867_no_name.phpt
index c1dda8156e..d68a61d929 100644
--- a/ext/session/tests/rfc1867_no_name.phpt
+++ b/ext/session/tests/rfc1867_no_name.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=0
session.upload_progress.enabled=1
diff --git a/ext/session/tests/rfc1867_sid_cookie.phpt b/ext/session/tests/rfc1867_sid_cookie.phpt
index 735a5ac201..2864799335 100644
--- a/ext/session/tests/rfc1867_sid_cookie.phpt
+++ b/ext/session/tests/rfc1867_sid_cookie.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=0
session.upload_progress.enabled=1
diff --git a/ext/session/tests/rfc1867_sid_get.phpt b/ext/session/tests/rfc1867_sid_get.phpt
index cc5a793e7b..e3a48a1c13 100644
--- a/ext/session/tests/rfc1867_sid_get.phpt
+++ b/ext/session/tests/rfc1867_sid_get.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=0
session.upload_progress.enabled=1
diff --git a/ext/session/tests/rfc1867_sid_get_2.phpt b/ext/session/tests/rfc1867_sid_get_2.phpt
index 1d22e5930b..e21ca4ca2b 100644
--- a/ext/session/tests/rfc1867_sid_get_2.phpt
+++ b/ext/session/tests/rfc1867_sid_get_2.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=0
session.use_only_cookies=0
session.upload_progress.enabled=1
diff --git a/ext/session/tests/rfc1867_sid_only_cookie.phpt b/ext/session/tests/rfc1867_sid_only_cookie.phpt
index 9a0105668f..41f6761fb9 100644
--- a/ext/session/tests/rfc1867_sid_only_cookie.phpt
+++ b/ext/session/tests/rfc1867_sid_only_cookie.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=1
session.upload_progress.enabled=1
diff --git a/ext/session/tests/rfc1867_sid_post.phpt b/ext/session/tests/rfc1867_sid_post.phpt
index 7c1eb2de5d..107957f8db 100644
--- a/ext/session/tests/rfc1867_sid_post.phpt
+++ b/ext/session/tests/rfc1867_sid_post.phpt
@@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
+session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=0
session.upload_progress.enabled=1
diff --git a/ext/session/tests/session_id_basic.phpt b/ext/session/tests/session_id_basic.phpt
index 5cb13c25ea..852d2f9578 100644
--- a/ext/session/tests/session_id_basic.phpt
+++ b/ext/session/tests/session_id_basic.phpt
@@ -20,6 +20,8 @@ var_dump(session_id("test"));
var_dump(session_id());
var_dump(session_id("1234567890"));
var_dump(session_id());
+// Turn off strice mode, since it does not allow uninitialized session ID
+ini_set('session.use_strict_mode',false);
var_dump(session_start());
var_dump(session_id());
var_dump(session_destroy());