Annotation of embedaddon/php/ext/session/tests/session_id_variation2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test session_id() function : variation
! 3: --SKIPIF--
! 4: <?php include('skipif.inc'); ?>
! 5: --INI--
! 6: session.hash_function=0
! 7: --FILE--
! 8: <?php
! 9:
! 10: ob_start();
! 11:
! 12: /*
! 13: * Prototype : string session_id([string $id])
! 14: * Description : Get and/or set the current session id
! 15: * Source code : ext/session/session.c
! 16: */
! 17:
! 18: echo "*** Testing session_id() : variation ***\n";
! 19:
! 20: $directory = dirname(__FILE__);
! 21: $filename = ($directory."/entropy.txt");
! 22: var_dump(ini_set("session.entropy_file", $filename));
! 23: var_dump(file_put_contents($filename, "Hello World!"));
! 24: var_dump(ini_set("session.entropy_length", filesize($filename)));
! 25:
! 26: var_dump(ini_set("session.hash_function", 0));
! 27: var_dump(session_id());
! 28: var_dump(session_start());
! 29: var_dump(session_id());
! 30: var_dump(session_destroy());
! 31:
! 32: var_dump(ini_set("session.hash_function", 1));
! 33: var_dump(session_id());
! 34: var_dump(session_start());
! 35: var_dump(session_id());
! 36: var_dump(session_destroy());
! 37: var_dump(unlink($filename));
! 38:
! 39: echo "Done";
! 40: ob_end_flush();
! 41: ?>
! 42: --EXPECTF--
! 43: *** Testing session_id() : variation ***
! 44: string(0) ""
! 45: int(12)
! 46: string(1) "0"
! 47: string(1) "0"
! 48: string(0) ""
! 49: bool(true)
! 50: string(%d) "%s"
! 51: bool(true)
! 52: string(1) "0"
! 53: string(0) ""
! 54: bool(true)
! 55: string(%d) "%s"
! 56: bool(true)
! 57: bool(true)
! 58: Done
! 59:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>