php-src/ext/session/tests/session_set_cookie_params_variation3.phpt
Ant Phillips 79b73d1218 New set of session extension tests for PHP 5.3 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, nor do they test anything
with register_globals enabled.
2008-04-22 16:04:30 +00:00

50 lines
1.2 KiB
PHP

--TEST--
Test session_set_cookie_params() function : variation
--INI--
session.cookie_domain=foo
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
ob_start();
/*
* Prototype : void session_set_cookie_params(int $lifetime [, string $path [, string $domain [, bool $secure [, bool $httponly]]]])
* Description : Set the session cookie parameters
* Source code : ext/session/session.c
*/
echo "*** Testing session_set_cookie_params() : variation ***\n";
var_dump(ini_get("session.cookie_domain"));
var_dump(session_set_cookie_params(3600, "/path", "blah"));
var_dump(ini_get("session.cookie_domain"));
var_dump(session_start());
var_dump(ini_get("session.cookie_domain"));
var_dump(session_set_cookie_params(3600, "/path", "guff"));
var_dump(ini_get("session.cookie_domain"));
var_dump(session_destroy());
var_dump(ini_get("session.cookie_domain"));
var_dump(session_set_cookie_params(3600, "/path", "foo"));
var_dump(ini_get("session.cookie_domain"));
echo "Done";
ob_end_flush();
?>
--EXPECTF--
*** Testing session_set_cookie_params() : variation ***
string(3) "foo"
NULL
string(4) "blah"
bool(true)
string(4) "blah"
NULL
string(4) "guff"
bool(true)
string(4) "guff"
NULL
string(3) "foo"
Done