diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
|---|---|---|
| committer | <> | 2013-04-03 16:25:08 +0000 |
| commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
| tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/session/tests/session_save_path_variation4.phpt | |
| download | php2-master.tar.gz | |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/session/tests/session_save_path_variation4.phpt')
| -rw-r--r-- | ext/session/tests/session_save_path_variation4.phpt | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/ext/session/tests/session_save_path_variation4.phpt b/ext/session/tests/session_save_path_variation4.phpt new file mode 100644 index 0000000..80db6ca --- /dev/null +++ b/ext/session/tests/session_save_path_variation4.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test session_save_path() function : variation +--SKIPIF-- +<?php include('skipif.inc');?> +--INI-- +open_basedir=. +session.save_handler=files +session.save_path= +session.name=PHPSESSID +--FILE-- +<?php + +ob_start(); + +/* + * Prototype : string session_save_path([string $path]) + * Description : Get and/or set the current session save path + * Source code : ext/session/session.c + */ + +echo "*** Testing session_save_path() : variation ***\n"; +$initdir = getcwd(); +$sessions = ($initdir."/sessions"); + +chdir($initdir); + +// Delete the existing directory +if (file_exists($sessions) === TRUE) { + @rmdir($sessions); +} + +var_dump(mkdir($sessions)); +var_dump(chdir($sessions)); +ini_set("session.save_path", $initdir); +var_dump(session_save_path()); +var_dump(session_start()); +var_dump(session_save_path()); +var_dump(session_destroy()); +var_dump(session_save_path()); +var_dump(rmdir($sessions)); + +echo "Done"; +ob_end_flush(); +?> +--CLEAN-- +$initdir = getcwd(); +$sessions = ($initdir."/sessions"); +var_dump(rmdir($sessions)); +--EXPECTF-- +*** Testing session_save_path() : variation *** +bool(true) +bool(true) + +Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d +string(0) "" + +Warning: session_start(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d + +Fatal error: session_start(): Failed to initialize storage module: files (path: ) in %s on line %d + |
