1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/ext/session/tests/session_save_path_variation1.phpt
Calvin Buckley 84d6cb8cf0 Unify headers already sent/session already started error handler (#16451)
* Unify headers already sent errors

Now whenever we need to check where headers were already sent in
ext/session, we call a single location that prints where, keeping it
consistent output wise.

* Unify session aready started errors

Similar to the one for headers.

* Also change session active checks too

This usually go hand in hand with the headers already sent checks, but
is in a separate commit because of the amount of tests it changes.
2024-10-17 13:13:56 -03:00

49 lines
1008 B
PHP

--TEST--
Test session_save_path() function : variation
--INI--
session.gc_probability=0
session.save_path=
session.name=PHPSESSID
session.save_handler=files
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
ob_start();
echo "*** Testing session_save_path() : variation ***\n";
$directory = __DIR__;
var_dump(session_save_path());
var_dump(session_save_path($directory));
var_dump(session_save_path());
var_dump(session_start());
var_dump(session_save_path());
var_dump(session_save_path($directory));
var_dump(session_save_path());
var_dump(session_destroy());
var_dump(session_save_path());
echo "Done";
ob_end_flush();
?>
--EXPECTF--
*** Testing session_save_path() : variation ***
string(0) ""
string(0) ""
string(%d) "%stests"
bool(true)
string(%d) "%stests"
Warning: session_save_path(): Session save path cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(false)
string(%d) "%stests"
bool(true)
string(%d) "%stests"
Done