1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 11:42:17 +02:00
Files
archived-php-src/ext/session/tests/session_get_cookie_params_basic.phpt
Ant Phillips 168e58d2da New set of session extension tests for PHP 6.0 branch.
These hopefully test a reasonable set of basic, error and variations for
the twenty or so session functions. Note however that they do not
test all the session configuration settings.
2008-04-22 16:05:42 +00:00

110 lines
1.8 KiB
PHP

--TEST--
Test session_get_cookie_params() function : basic functionality
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
ob_start();
/*
* Prototype : array session_get_cookie_params(void)
* Description : Get the session cookie parameters
* Source code : ext/session/session.c
*/
echo "*** Testing session_get_cookie_params() : basic functionality ***\n";
var_dump(session_get_cookie_params());
var_dump(session_set_cookie_params(3600, "/path", "blah", FALSE, FALSE));
var_dump(session_get_cookie_params());
var_dump(session_set_cookie_params(1234567890, "/guff", "foo", TRUE, TRUE));
var_dump(session_get_cookie_params());
echo "Done";
ob_end_flush();
?>
--EXPECTF--
*** Testing session_get_cookie_params() : basic functionality ***
array(5) {
["lifetime"]=>
int(0)
["path"]=>
string(1) "/"
["domain"]=>
string(0) ""
["secure"]=>
bool(false)
["httponly"]=>
bool(false)
}
NULL
array(5) {
["lifetime"]=>
int(3600)
["path"]=>
string(5) "/path"
["domain"]=>
string(4) "blah"
["secure"]=>
bool(false)
["httponly"]=>
bool(false)
}
NULL
array(5) {
["lifetime"]=>
int(1234567890)
["path"]=>
string(5) "/guff"
["domain"]=>
string(3) "foo"
["secure"]=>
bool(true)
["httponly"]=>
bool(true)
}
Done
--UEXPECTF--
*** Testing session_get_cookie_params() : basic functionality ***
array(5) {
[u"lifetime"]=>
int(0)
[u"path"]=>
unicode(1) "/"
[u"domain"]=>
unicode(0) ""
[u"secure"]=>
bool(false)
[u"httponly"]=>
bool(false)
}
NULL
array(5) {
[u"lifetime"]=>
int(3600)
[u"path"]=>
unicode(5) "/path"
[u"domain"]=>
unicode(4) "blah"
[u"secure"]=>
bool(false)
[u"httponly"]=>
bool(false)
}
NULL
array(5) {
[u"lifetime"]=>
int(1234567890)
[u"path"]=>
unicode(5) "/guff"
[u"domain"]=>
unicode(3) "foo"
[u"secure"]=>
bool(true)
[u"httponly"]=>
bool(true)
}
Done