Annotation of embedaddon/php/ext/session/tests/session_destroy_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test session_destroy() function : error functionality
! 3: --SKIPIF--
! 4: <?php include('skipif.inc'); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: ob_start();
! 9:
! 10: /*
! 11: * Prototype : bool session_destroy(void)
! 12: * Description : Destroys all data registered to a session
! 13: * Source code : ext/session/session.c
! 14: */
! 15:
! 16: echo "*** Testing session_destroy() : error functionality ***\n";
! 17:
! 18: // Get an unset variable
! 19: $unset_var = 10;
! 20: unset($unset_var);
! 21:
! 22: class classA
! 23: {
! 24: public function __toString() {
! 25: return "Hello World!";
! 26: }
! 27: }
! 28:
! 29: $heredoc = <<<EOT
! 30: Hello World!
! 31: EOT;
! 32:
! 33: $fp = fopen(__FILE__, "r");
! 34:
! 35: // Unexpected values to be passed as arguments
! 36: $inputs = array(
! 37:
! 38: // Integer data
! 39: /*1*/ 0,
! 40: 1,
! 41: 12345,
! 42: -2345,
! 43:
! 44: // Float data
! 45: /*5*/ 10.5,
! 46: -10.5,
! 47: 12.3456789000e10,
! 48: 12.3456789000E-10,
! 49: .5,
! 50:
! 51: // Null data
! 52: /*10*/ NULL,
! 53: null,
! 54:
! 55: // Boolean data
! 56: /*12*/ true,
! 57: false,
! 58: TRUE,
! 59: FALSE,
! 60:
! 61: // Empty strings
! 62: /*16*/ "",
! 63: '',
! 64:
! 65: // Invalid string data
! 66: /*18*/ "Nothing",
! 67: 'Nothing',
! 68: $heredoc,
! 69:
! 70: // Object data
! 71: /*21*/ new classA(),
! 72:
! 73: // Undefined data
! 74: /*22*/ @$undefined_var,
! 75:
! 76: // Unset data
! 77: /*23*/ @$unset_var,
! 78:
! 79: // Resource variable
! 80: /*24*/ $fp
! 81: );
! 82:
! 83:
! 84: $iterator = 1;
! 85: foreach($inputs as $input) {
! 86: echo "\n-- Iteration $iterator --\n";
! 87: var_dump(session_destroy($input));
! 88: $iterator++;
! 89: };
! 90:
! 91: fclose($fp);
! 92: echo "Done";
! 93: ob_end_flush();
! 94: ?>
! 95: --EXPECTF--
! 96: *** Testing session_destroy() : error functionality ***
! 97:
! 98: -- Iteration 1 --
! 99:
! 100: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 101: NULL
! 102:
! 103: -- Iteration 2 --
! 104:
! 105: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 106: NULL
! 107:
! 108: -- Iteration 3 --
! 109:
! 110: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 111: NULL
! 112:
! 113: -- Iteration 4 --
! 114:
! 115: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 116: NULL
! 117:
! 118: -- Iteration 5 --
! 119:
! 120: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 121: NULL
! 122:
! 123: -- Iteration 6 --
! 124:
! 125: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 126: NULL
! 127:
! 128: -- Iteration 7 --
! 129:
! 130: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 131: NULL
! 132:
! 133: -- Iteration 8 --
! 134:
! 135: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 136: NULL
! 137:
! 138: -- Iteration 9 --
! 139:
! 140: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 141: NULL
! 142:
! 143: -- Iteration 10 --
! 144:
! 145: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 146: NULL
! 147:
! 148: -- Iteration 11 --
! 149:
! 150: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 151: NULL
! 152:
! 153: -- Iteration 12 --
! 154:
! 155: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 156: NULL
! 157:
! 158: -- Iteration 13 --
! 159:
! 160: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 161: NULL
! 162:
! 163: -- Iteration 14 --
! 164:
! 165: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 166: NULL
! 167:
! 168: -- Iteration 15 --
! 169:
! 170: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 171: NULL
! 172:
! 173: -- Iteration 16 --
! 174:
! 175: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 176: NULL
! 177:
! 178: -- Iteration 17 --
! 179:
! 180: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 181: NULL
! 182:
! 183: -- Iteration 18 --
! 184:
! 185: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 186: NULL
! 187:
! 188: -- Iteration 19 --
! 189:
! 190: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 191: NULL
! 192:
! 193: -- Iteration 20 --
! 194:
! 195: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 196: NULL
! 197:
! 198: -- Iteration 21 --
! 199:
! 200: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 201: NULL
! 202:
! 203: -- Iteration 22 --
! 204:
! 205: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 206: NULL
! 207:
! 208: -- Iteration 23 --
! 209:
! 210: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 211: NULL
! 212:
! 213: -- Iteration 24 --
! 214:
! 215: Warning: session_destroy() expects exactly 0 parameters, 1 given in %s on line %d
! 216: NULL
! 217: Done
! 218:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>