diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/session/tests/session_decode_error2.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/session/tests/session_decode_error2.phpt')
-rw-r--r-- | ext/session/tests/session_decode_error2.phpt | 615 |
1 files changed, 615 insertions, 0 deletions
diff --git a/ext/session/tests/session_decode_error2.phpt b/ext/session/tests/session_decode_error2.phpt new file mode 100644 index 0000000..4160f87 --- /dev/null +++ b/ext/session/tests/session_decode_error2.phpt @@ -0,0 +1,615 @@ +--TEST-- +Test session_decode() function : error functionality +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php + +ob_start(); + +/* + * Prototype : string session_decode(void) + * Description : Decodes session data from a string + * Source code : ext/session/session.c + */ + +echo "*** Testing session_decode() : error functionality ***\n"; +$data = "foo|a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}guff|R:1;blah|R:1;"; + +var_dump(session_start()); +for($index = 0; $index < strlen($data); $index++) { + echo "\n-- Iteration $index --\n"; + $encoded = substr($data, 0, $index); + var_dump(session_decode($encoded)); + var_dump($_SESSION); +}; + +var_dump(session_destroy()); +echo "Done"; +ob_end_flush(); +?> +--EXPECTF-- +*** Testing session_decode() : error functionality *** +bool(true) + +-- Iteration 0 -- +bool(true) +array(0) { +} + +-- Iteration 1 -- +bool(true) +array(0) { +} + +-- Iteration 2 -- +bool(true) +array(0) { +} + +-- Iteration 3 -- +bool(true) +array(0) { +} + +-- Iteration 4 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 5 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 6 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 7 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 8 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 9 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 10 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 11 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 12 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 13 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 14 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 15 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 16 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 17 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 18 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 19 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 20 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 21 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 22 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 23 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 24 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 25 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 26 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 27 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 28 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 29 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 30 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 31 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 32 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 33 -- +bool(true) +array(1) { + ["foo"]=> + NULL +} + +-- Iteration 34 -- +bool(true) +array(1) { + ["foo"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} + +-- Iteration 35 -- +bool(true) +array(1) { + ["foo"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} + +-- Iteration 36 -- +bool(true) +array(1) { + ["foo"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} + +-- Iteration 37 -- +bool(true) +array(1) { + ["foo"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} + +-- Iteration 38 -- +bool(true) +array(1) { + ["foo"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} + +-- Iteration 39 -- +bool(true) +array(2) { + ["foo"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + NULL +} + +-- Iteration 40 -- +bool(true) +array(2) { + ["foo"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + NULL +} + +-- Iteration 41 -- +bool(true) +array(2) { + ["foo"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + NULL +} + +-- Iteration 42 -- +bool(true) +array(2) { + ["foo"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + NULL +} + +-- Iteration 43 -- +bool(true) +array(2) { + ["foo"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} + +-- Iteration 44 -- +bool(true) +array(2) { + ["foo"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} + +-- Iteration 45 -- +bool(true) +array(2) { + ["foo"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} + +-- Iteration 46 -- +bool(true) +array(2) { + ["foo"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} + +-- Iteration 47 -- +bool(true) +array(2) { + ["foo"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} + +-- Iteration 48 -- +bool(true) +array(3) { + ["foo"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["blah"]=> + NULL +} + +-- Iteration 49 -- +bool(true) +array(3) { + ["foo"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["blah"]=> + NULL +} + +-- Iteration 50 -- +bool(true) +array(3) { + ["foo"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["blah"]=> + NULL +} + +-- Iteration 51 -- +bool(true) +array(3) { + ["foo"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["guff"]=> + &array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["blah"]=> + NULL +} +bool(true) +Done + |