Annotation of embedaddon/php/ext/session/tests/session_decode_variation4.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test session_decode() function : variation
! 3: --SKIPIF--
! 4: <?php include('skipif.inc'); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: ob_start();
! 9:
! 10: /*
! 11: * Prototype : string session_decode(void)
! 12: * Description : Decodes session data from a string
! 13: * Source code : ext/session/session.c
! 14: */
! 15:
! 16: echo "*** Testing session_decode() : variation ***\n";
! 17:
! 18: var_dump(session_start());
! 19: var_dump($_SESSION);
! 20: $_SESSION["foo"] = 1234567890;
! 21: $_SESSION["bar"] = "Blah!";
! 22: $_SESSION["guff"] = 123.456;
! 23: var_dump($_SESSION);
! 24: $encoded = "A2Zvb2k6MTIzNDU2Nzg5MDs=";
! 25: var_dump(session_decode(base64_decode($encoded)));
! 26: var_dump($_SESSION);
! 27: var_dump(session_destroy());
! 28:
! 29: echo "Done";
! 30: ob_end_flush();
! 31: ?>
! 32: --EXPECTF--
! 33: *** Testing session_decode() : variation ***
! 34: bool(true)
! 35: array(0) {
! 36: }
! 37: array(3) {
! 38: ["foo"]=>
! 39: int(1234567890)
! 40: ["bar"]=>
! 41: string(5) "Blah!"
! 42: ["guff"]=>
! 43: float(123.456)
! 44: }
! 45: bool(true)
! 46: array(3) {
! 47: ["foo"]=>
! 48: int(1234567890)
! 49: ["bar"]=>
! 50: string(5) "Blah!"
! 51: ["guff"]=>
! 52: float(123.456)
! 53: }
! 54: bool(true)
! 55: Done
! 56:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>