]> granicus.if.org Git - php/commitdiff
Latest and greatest versions of these session tests - checked on 6.0 snap on Windows...
authorAnt Phillips <ant@php.net>
Thu, 27 Nov 2008 13:49:45 +0000 (13:49 +0000)
committerAnt Phillips <ant@php.net>
Thu, 27 Nov 2008 13:49:45 +0000 (13:49 +0000)
ext/session/tests/session_module_name_variation3.phpt
ext/session/tests/session_name_basic.phpt
ext/session/tests/session_name_error.phpt
ext/session/tests/session_name_variation1.phpt
ext/session/tests/session_save_path_basic.phpt
ext/session/tests/session_save_path_error.phpt
ext/session/tests/session_save_path_variation1.phpt
ext/session/tests/session_save_path_variation4.phpt
ext/session/tests/session_set_save_handler_basic.phpt

index 1306cf3ec79dfa7f29990c1e5ee23c8968f9f896..11b6e576270766847ab7bca96f918b26f4d6ee40 100644 (file)
@@ -38,6 +38,17 @@ ob_end_flush();
 ?>
 --EXPECTF--
 *** Testing session_module_name() : variation ***
+string(%d) "%s"
+string(4) "user"
+
+Fatal error: Uncaught exception 'Exception' with message 'Stop...!' in %s:%d
+Stack trace:
+#0 [internal function]: open('', 'PHPSESSID')
+#1 %s(%d): session_start()
+#2 {main}
+  thrown in %s on line %d
+--UEXPECTF--
+*** Testing session_module_name() : variation ***
 unicode(5) "files"
 unicode(4) "user"
 
index 7834b74788270905481f5b570888d298ff8e03a6..4866caa4a8351d48ceecbfffdfb01d66d82a0a54 100644 (file)
@@ -30,6 +30,15 @@ ob_end_flush();
 ?>
 --EXPECTF--
 *** Testing session_name() : error functionality ***
+string(9) "PHPSESSID"
+string(9) "PHPSESSID"
+bool(true)
+string(4) "blah"
+bool(true)
+string(4) "blah"
+Done
+--UEXPECTF--
+*** Testing session_name() : error functionality ***
 unicode(9) "PHPSESSID"
 unicode(9) "PHPSESSID"
 bool(true)
index d6cb78c746b87707d7f6be3cbcaedcb7cdc530ab..ca01e9bb59151019c9aee717a69e262581c000fd 100644 (file)
@@ -97,6 +97,83 @@ ob_end_flush();
 --EXPECTF--
 *** Testing session_name() : error functionality ***
 
+-- Iteration 1 --
+string(9) "PHPSESSID"
+
+-- Iteration 2 --
+string(1) "0"
+
+-- Iteration 3 --
+string(1) "1"
+
+-- Iteration 4 --
+string(5) "12345"
+
+-- Iteration 5 --
+string(5) "-2345"
+
+-- Iteration 6 --
+string(4) "10.5"
+
+-- Iteration 7 --
+string(5) "-10.5"
+
+-- Iteration 8 --
+string(12) "123456789000"
+
+-- Iteration 9 --
+string(13) "1.23456789E-9"
+
+-- Iteration 10 --
+string(3) "0.5"
+
+-- Iteration 11 --
+string(0) ""
+
+-- Iteration 12 --
+string(0) ""
+
+-- Iteration 13 --
+string(1) "1"
+
+-- Iteration 14 --
+string(0) ""
+
+-- Iteration 15 --
+string(1) "1"
+
+-- Iteration 16 --
+string(0) ""
+
+-- Iteration 17 --
+string(0) ""
+
+-- Iteration 18 --
+string(0) ""
+
+-- Iteration 19 --
+string(7) "Nothing"
+
+-- Iteration 20 --
+string(7) "Nothing"
+
+-- Iteration 21 --
+string(12) "Hello World!"
+
+-- Iteration 22 --
+string(12) "Hello World!"
+
+-- Iteration 23 --
+string(0) ""
+
+-- Iteration 24 --
+
+Warning: session_name() expects parameter 1 to be string, resource given in %s on line %d
+NULL
+Done
+--UEXPECTF--
+*** Testing session_name() : error functionality ***
+
 -- Iteration 1 --
 unicode(9) "PHPSESSID"
 
index 930541e1022ee9952e21038c071d3f0e6d40a2e4..289d6ca3c7b74b19fccc9dde45c1bdd366ac64aa 100644 (file)
@@ -41,6 +41,24 @@ ob_end_flush();
 ?>
 --EXPECTF--
 *** Testing session_name() : variation ***
+string(9) "PHPSESSID"
+bool(true)
+string(0) ""
+bool(true)
+string(0) ""
+string(0) ""
+bool(true)
+string(1) "    "
+bool(true)
+string(1) "    "
+string(1) "    "
+bool(true)
+string(0) ""
+bool(true)
+string(0) ""
+Done
+--UEXPECTF--
+*** Testing session_name() : variation ***
 unicode(9) "PHPSESSID"
 bool(true)
 unicode(0) ""
index c7663f4a3e179aae5206b993806d815e7482c1dc..47258f17a7a02ea4852b1b94d0d601b25020c3f1 100644 (file)
@@ -29,6 +29,12 @@ ob_end_flush();
 ?>
 --EXPECTF--
 *** Testing session_save_path() : error functionality ***
+string(0) ""
+string(0) ""
+string(%d) "%s"
+Done
+--UEXPECTF--
+*** Testing session_save_path() : error functionality ***
 unicode(0) ""
 unicode(0) ""
 unicode(%d) "%s"
index f2d19128e0c8b331621bbf1bab273a04083fcd60..3e92597877a8fdd2e1442f62bad56cfc40a70cb2 100644 (file)
@@ -101,6 +101,83 @@ ob_end_flush();
 --EXPECTF--
 *** Testing session_save_path() : error functionality ***
 
+-- Iteration 1 --
+string(0) ""
+
+-- Iteration 2 --
+string(1) "0"
+
+-- Iteration 3 --
+string(1) "1"
+
+-- Iteration 4 --
+string(5) "12345"
+
+-- Iteration 5 --
+string(5) "-2345"
+
+-- Iteration 6 --
+string(4) "10.5"
+
+-- Iteration 7 --
+string(5) "-10.5"
+
+-- Iteration 8 --
+string(12) "123456789000"
+
+-- Iteration 9 --
+string(13) "1.23456789E-9"
+
+-- Iteration 10 --
+string(3) "0.5"
+
+-- Iteration 11 --
+string(0) ""
+
+-- Iteration 12 --
+string(0) ""
+
+-- Iteration 13 --
+string(1) "1"
+
+-- Iteration 14 --
+string(0) ""
+
+-- Iteration 15 --
+string(1) "1"
+
+-- Iteration 16 --
+string(0) ""
+
+-- Iteration 17 --
+string(0) ""
+
+-- Iteration 18 --
+string(0) ""
+
+-- Iteration 19 --
+string(7) "Nothing"
+
+-- Iteration 20 --
+string(7) "Nothing"
+
+-- Iteration 21 --
+string(12) "Hello World!"
+
+-- Iteration 22 --
+string(12) "Hello World!"
+
+-- Iteration 23 --
+string(0) ""
+
+-- Iteration 24 --
+
+Warning: session_save_path() expects parameter 1 to be string, resource given in %s on line %d
+NULL
+Done
+--UEXPECTF--
+*** Testing session_save_path() : error functionality ***
+
 -- Iteration 1 --
 unicode(0) ""
 
index a53a9b204d3687750b0327f67afb41749a26fc39..b79902c3474745498e35157cb30960c740da2f4c 100644 (file)
@@ -33,6 +33,16 @@ ob_end_flush();
 ?>
 --EXPECTF--
 *** Testing session_save_path() : variation ***
+string(0) ""
+bool(true)
+string(0) ""
+string(0) ""
+string(%d) "%s"
+bool(true)
+string(%d) "%s"
+Done
+--UEXPECTF--
+*** Testing session_save_path() : variation ***
 unicode(0) ""
 bool(true)
 unicode(0) ""
index 899c923af1424d465d827be3622a6e45494550dd..d7a1b3c11bde01e855bcf9b98fc22d6ff552f1a4 100644 (file)
@@ -22,10 +22,10 @@ ob_start();
  */
 
 echo "*** Testing session_save_path() : variation ***\n";
-$directory = dirname(__FILE__);
-$sessions = ($directory."/sessions");
+$initdir = getcwd();
+$sessions = ($initdir."/sessions");
 
-chdir($directory);
+chdir($initdir);
 
 // Delete the existing directory
 if (file_exists($sessions) === TRUE) {
@@ -34,7 +34,7 @@ if (file_exists($sessions) === TRUE) {
 
 var_dump(mkdir($sessions));
 var_dump(chdir($sessions));
-ini_set("session.save_path", $directory);
+ini_set("session.save_path", $initdir);
 var_dump(session_save_path());
 var_dump(session_start());
 var_dump(session_save_path());
@@ -46,11 +46,9 @@ echo "Done";
 ob_end_flush();
 ?>
 --CLEAN--
-<?php
-$directory = dirname(__FILE__);
-$sessions = ($directory."/sessions");
+$initdir = getcwd();
+$sessions = ($initdir."/sessions");
 var_dump(rmdir($sessions));
-?>
 --EXPECTF--
 *** Testing session_save_path() : variation ***
 bool(true)
index 4893e61854ed983b6bca5f64ba16034da6a4474e..366f9dc80c62c702fd1107c641214abe76937786 100644 (file)
@@ -50,6 +50,52 @@ ob_end_flush();
 --EXPECTF--
 *** Testing session_set_save_handler() : basic functionality ***
 
+string(5) "files"
+
+Warning: session_module_name(): Cannot find named PHP session module () in %s on line %d
+bool(false)
+
+Warning: session_module_name(): Cannot find named PHP session module (blah) in %s on line %d
+bool(false)
+
+Warning: session_module_name(): Cannot find named PHP session module (foo) in %s on line %d
+bool(false)
+Open [%s,PHPSESSID]
+Read [%s,%s]
+array(3) {
+  ["Blah"]=>
+  string(12) "Hello World!"
+  ["Foo"]=>
+  bool(false)
+  ["Guff"]=>
+  int(1234567890)
+}
+Write [%s,%s,Blah|S:12:"Hello World!";Foo|b:0;Guff|i:1234567890;]
+Close [%s,PHPSESSID]
+array(3) {
+  ["Blah"]=>
+  string(12) "Hello World!"
+  ["Foo"]=>
+  bool(false)
+  ["Guff"]=>
+  int(1234567890)
+}
+Starting session again..!
+Open [%s,PHPSESSID]
+Read [%s,%s]
+array(3) {
+  ["Blah"]=>
+  string(12) "Hello World!"
+  ["Foo"]=>
+  bool(false)
+  ["Guff"]=>
+  int(1234567890)
+}
+Write [%s,%s,Blah|S:12:"Hello World!";Foo|b:0;Guff|i:1234567890;]
+Close [%s,PHPSESSID]
+--UEXPECTF--
+*** Testing session_set_save_handler() : basic functionality ***
+
 unicode(5) "files"
 
 Warning: session_module_name(): Cannot find named PHP session module () in %s on line %d