Annotation of embedaddon/php/ext/session/tests/session_decode_variation2.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test session_decode() function : basic functionality
                      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"] = "Hello World!";
                     22: $_SESSION["guff"] = 123.456;
                     23: var_dump($_SESSION);
                     24: var_dump(session_decode("foo|a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}guff|R:1;blah|R:1;"));
                     25: var_dump($_SESSION);
                     26: var_dump(session_destroy());
                     27: 
                     28: echo "Done";
                     29: ob_end_flush();
                     30: ?>
                     31: --EXPECTF--
                     32: *** Testing session_decode() : variation ***
                     33: bool(true)
                     34: array(0) {
                     35: }
                     36: array(3) {
                     37:   ["foo"]=>
                     38:   int(1234567890)
                     39:   ["bar"]=>
                     40:   string(12) "Hello World!"
                     41:   ["guff"]=>
                     42:   float(123.456)
                     43: }
                     44: bool(true)
                     45: array(4) {
                     46:   ["foo"]=>
                     47:   &array(3) {
                     48:     [0]=>
                     49:     int(1)
                     50:     [1]=>
                     51:     int(2)
                     52:     [2]=>
                     53:     int(3)
                     54:   }
                     55:   ["bar"]=>
                     56:   string(12) "Hello World!"
                     57:   ["guff"]=>
                     58:   &array(3) {
                     59:     [0]=>
                     60:     int(1)
                     61:     [1]=>
                     62:     int(2)
                     63:     [2]=>
                     64:     int(3)
                     65:   }
                     66:   ["blah"]=>
                     67:   &array(3) {
                     68:     [0]=>
                     69:     int(1)
                     70:     [1]=>
                     71:     int(2)
                     72:     [2]=>
                     73:     int(3)
                     74:   }
                     75: }
                     76: bool(true)
                     77: Done
                     78: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>