mirror of
https://github.com/php/php-src.git
synced 2024-12-15 12:54:57 +08:00
ded3d984c6
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
51 lines
868 B
PHP
51 lines
868 B
PHP
--TEST--
|
|
Test session_reset() function : basic functionality
|
|
--SKIPIF--
|
|
<?php include('skipif.inc'); ?>
|
|
--INI--
|
|
session.save_path=
|
|
session.name=PHPSESSID
|
|
session.save_handler=files
|
|
--FILE--
|
|
<?php
|
|
|
|
ob_start();
|
|
|
|
/*
|
|
* Prototype : void session_reset(void)
|
|
* Description : Should abort session. Session data should not be written.
|
|
* Source code : ext/session/session.c
|
|
*/
|
|
|
|
echo "*** Testing session_abort() : basic functionality ***\n";
|
|
|
|
session_start();
|
|
$session_id = session_id();
|
|
$_SESSION['foo'] = 123;
|
|
session_commit();
|
|
|
|
session_id($session_id);
|
|
session_start();
|
|
$_SESSION['bar'] = 456;
|
|
var_dump($_SESSION);
|
|
session_reset();
|
|
|
|
var_dump($_SESSION); // Should only have 'foo'
|
|
|
|
echo "Done".PHP_EOL;
|
|
|
|
?>
|
|
--EXPECT--
|
|
*** Testing session_abort() : basic functionality ***
|
|
array(2) {
|
|
["foo"]=>
|
|
int(123)
|
|
["bar"]=>
|
|
int(456)
|
|
}
|
|
array(1) {
|
|
["foo"]=>
|
|
int(123)
|
|
}
|
|
Done
|