summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2015-01-29 10:31:39 +0900
committerYasuo Ohgaki <yohgaki@php.net>2015-01-29 10:31:39 +0900
commit7a97eaf25d27468e23056a9ae554430e48d23293 (patch)
tree32f630983714589f7a95667038ce4efee6871148
parentf90f6108c83da86c8f9df8c610ad570d33c1cf09 (diff)
downloadphp-git-7a97eaf25d27468e23056a9ae554430e48d23293.tar.gz
Cleanup session id files after test
-rw-r--r--ext/session/tests/bug67694.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_basic.phpt1
-rw-r--r--ext/session/tests/session_set_save_handler_variation5.phpt15
-rw-r--r--ext/session/tests/session_set_save_handler_variation6.phpt11
4 files changed, 19 insertions, 10 deletions
diff --git a/ext/session/tests/bug67694.phpt b/ext/session/tests/bug67694.phpt
index 08a296923f..bf7089f2c2 100644
--- a/ext/session/tests/bug67694.phpt
+++ b/ext/session/tests/bug67694.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #67694 Regression in session_regenerate_id()
+Bug #67694 Regression in session_regenerate_id()
--INI--
session.save_handler = files
session.name=PHPSESSID
diff --git a/ext/session/tests/session_set_save_handler_basic.phpt b/ext/session/tests/session_set_save_handler_basic.phpt
index c8b406e5ab..5342acc92d 100644
--- a/ext/session/tests/session_set_save_handler_basic.phpt
+++ b/ext/session/tests/session_set_save_handler_basic.phpt
@@ -29,6 +29,7 @@ session_save_path($path);
session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
session_start();
+$session_id = session_id();
$_SESSION["Blah"] = "Hello World!";
$_SESSION["Foo"] = FALSE;
$_SESSION["Guff"] = 1234567890;
diff --git a/ext/session/tests/session_set_save_handler_variation5.phpt b/ext/session/tests/session_set_save_handler_variation5.phpt
index 4afcf64495..c721e2a46d 100644
--- a/ext/session/tests/session_set_save_handler_variation5.phpt
+++ b/ext/session/tests/session_set_save_handler_variation5.phpt
@@ -29,14 +29,14 @@ function noisy_gc($maxlifetime) {
echo "*** Testing session_set_save_handler() : variation ***\n";
require_once "save_handler.inc";
-$session_id = 'testid';
$path = dirname(__FILE__);
var_dump(session_save_path($path));
echo "*** Without lazy_write ***\n";
-var_dump(session_id($session_id));
var_dump(session_set_save_handler("open", "close", "read", "write", "destroy", "noisy_gc", "create_sid", "validate_sid", "update"));
var_dump(session_start(['lazy_write'=>FALSE]));
+$session_id = session_id();
+var_dump(session_id());
var_dump(session_write_close());
var_dump(session_id());
@@ -59,21 +59,20 @@ ob_end_flush();
string(0) ""
*** Without lazy_write ***
-string(0) ""
bool(true)
Open [%s,PHPSESSID]
-ValidateID [%s,testid]
CreateID [PHPT-%d]
Read [%s,PHPT-%d]
GC [0]
1 deleted
bool(true)
+string(%d) "PHPT-%d"
Write [%s,PHPT-%d,]
Close [%s,PHPSESSID]
NULL
-string(15) "PHPT-%d"
+string(%d) "PHPT-%d"
*** With lazy_write ***
-string(15) "PHPT-%d"
+string(%d) "PHPT-%d"
bool(true)
Open [%s,PHPSESSID]
ValidateID [%s,PHPT-%d]
@@ -84,9 +83,9 @@ bool(true)
Write [%s,PHPT-%d,]
Close [%s,PHPSESSID]
NULL
-string(15) "PHPT-%d"
+string(%d) "PHPT-%d"
*** Cleanup ***
-string(15) "PHPT-%d"
+string(%d) "PHPT-%d"
Open [%s,PHPSESSID]
ValidateID [%s,PHPT-%d]
Read [%s,PHPT-%d]
diff --git a/ext/session/tests/session_set_save_handler_variation6.phpt b/ext/session/tests/session_set_save_handler_variation6.phpt
index 159c85d631..3b4fe1ddf9 100644
--- a/ext/session/tests/session_set_save_handler_variation6.phpt
+++ b/ext/session/tests/session_set_save_handler_variation6.phpt
@@ -51,6 +51,10 @@ var_dump($_SESSION);
// $_SESSION should be the same and should skip write()
session_write_close();
+echo "Cleanup\n";
+session_start();
+session_destroy();
+
ob_end_flush();
?>
--EXPECTF--
@@ -104,4 +108,9 @@ array(4) {
string(3) "Foo"
}
Update [%s,PHPT-%d]
-Close [%s,PHPSESSID] \ No newline at end of file
+Close [%s,PHPSESSID]
+Cleanup
+Open [%s,PHPSESSID]
+Read [%s,PHPT-%d]
+Destroy [%s,PHPT-%d]
+Close [%s,PHPSESSID]