From: Ant Phillips Date: Thu, 27 Nov 2008 13:49:45 +0000 (+0000) Subject: Latest and greatest versions of these session tests - checked on 6.0 snap on Windows... X-Git-Tag: BEFORE_HEAD_NS_CHANGES_MERGE~71 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d88187cf9485c8fa685331ac6fa381494d390287;p=php Latest and greatest versions of these session tests - checked on 6.0 snap on Windows, Linux and Linux 64 bit. --- diff --git a/ext/session/tests/session_module_name_variation3.phpt b/ext/session/tests/session_module_name_variation3.phpt index 1306cf3ec7..11b6e57627 100644 --- a/ext/session/tests/session_module_name_variation3.phpt +++ b/ext/session/tests/session_module_name_variation3.phpt @@ -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" diff --git a/ext/session/tests/session_name_basic.phpt b/ext/session/tests/session_name_basic.phpt index 7834b74788..4866caa4a8 100644 --- a/ext/session/tests/session_name_basic.phpt +++ b/ext/session/tests/session_name_basic.phpt @@ -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) diff --git a/ext/session/tests/session_name_error.phpt b/ext/session/tests/session_name_error.phpt index d6cb78c746..ca01e9bb59 100644 --- a/ext/session/tests/session_name_error.phpt +++ b/ext/session/tests/session_name_error.phpt @@ -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" diff --git a/ext/session/tests/session_name_variation1.phpt b/ext/session/tests/session_name_variation1.phpt index 930541e102..289d6ca3c7 100644 --- a/ext/session/tests/session_name_variation1.phpt +++ b/ext/session/tests/session_name_variation1.phpt @@ -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) "" diff --git a/ext/session/tests/session_save_path_basic.phpt b/ext/session/tests/session_save_path_basic.phpt index c7663f4a3e..47258f17a7 100644 --- a/ext/session/tests/session_save_path_basic.phpt +++ b/ext/session/tests/session_save_path_basic.phpt @@ -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" diff --git a/ext/session/tests/session_save_path_error.phpt b/ext/session/tests/session_save_path_error.phpt index f2d19128e0..3e92597877 100644 --- a/ext/session/tests/session_save_path_error.phpt +++ b/ext/session/tests/session_save_path_error.phpt @@ -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) "" diff --git a/ext/session/tests/session_save_path_variation1.phpt b/ext/session/tests/session_save_path_variation1.phpt index a53a9b204d..b79902c347 100644 --- a/ext/session/tests/session_save_path_variation1.phpt +++ b/ext/session/tests/session_save_path_variation1.phpt @@ -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) "" diff --git a/ext/session/tests/session_save_path_variation4.phpt b/ext/session/tests/session_save_path_variation4.phpt index 899c923af1..d7a1b3c11b 100644 --- a/ext/session/tests/session_save_path_variation4.phpt +++ b/ext/session/tests/session_save_path_variation4.phpt @@ -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-- - --EXPECTF-- *** Testing session_save_path() : variation *** bool(true) diff --git a/ext/session/tests/session_set_save_handler_basic.phpt b/ext/session/tests/session_set_save_handler_basic.phpt index 4893e61854..366f9dc80c 100644 --- a/ext/session/tests/session_set_save_handler_basic.phpt +++ b/ext/session/tests/session_set_save_handler_basic.phpt @@ -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