Annotation of embedaddon/php/ext/imap/tests/imap_close_variation1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test imap_close() function : usage variations - different data types as $stream_id arg
! 3: --SKIPIF--
! 4: <?php
! 5: extension_loaded('imap') or die('skip imap extension not available in this build');
! 6: ?>
! 7: --FILE--
! 8: <?php
! 9: /* Prototype : bool imap_close(resource $stream_id [, int $options])
! 10: * Description: Close an IMAP stream
! 11: * Source code: ext/imap/php_imap.c
! 12: */
! 13:
! 14: /*
! 15: * Pass different data types as $stream_id argument to test behaviour of imap_close()
! 16: */
! 17:
! 18: echo "*** Testing imap_close() : usage variations ***\n";
! 19:
! 20: //get an unset variable
! 21: $unset_var = 10;
! 22: unset ($unset_var);
! 23:
! 24: // get a class
! 25: class classA
! 26: {
! 27: public function __toString() {
! 28: return "Class A object";
! 29: }
! 30: }
! 31:
! 32: // heredoc string
! 33: $heredoc = <<<EOT
! 34: hello world
! 35: EOT;
! 36:
! 37: // unexpected values to be passed to $stream_id argument
! 38: $inputs = array(
! 39:
! 40: // int data
! 41: /*1*/ 0,
! 42: 1,
! 43: 12345,
! 44: -2345,
! 45:
! 46: // float data
! 47: /*5*/ 10.5,
! 48: -10.5,
! 49: 12.3456789000e10,
! 50: 12.3456789000E-10,
! 51: .5,
! 52:
! 53: // null data
! 54: /*10*/ NULL,
! 55: null,
! 56:
! 57: // boolean data
! 58: /*12*/ true,
! 59: false,
! 60: TRUE,
! 61: FALSE,
! 62:
! 63: // empty data
! 64: /*16*/ "",
! 65: '',
! 66: array(),
! 67:
! 68: // string data
! 69: /*19*/ "string",
! 70: 'string',
! 71: $heredoc,
! 72:
! 73: // object data
! 74: /*22*/ new classA(),
! 75:
! 76: // undefined data
! 77: /*23*/ @$undefined_var,
! 78:
! 79: // unset data
! 80: /*24*/ @$unset_var,
! 81: );
! 82:
! 83: // loop through each element of $inputs to check the behavior of imap_close()
! 84: $iterator = 1;
! 85: foreach($inputs as $input) {
! 86: echo "\n-- Iteration $iterator --\n";
! 87: var_dump( imap_close($input) );
! 88: $iterator++;
! 89: };
! 90: ?>
! 91: ===DONE===
! 92: --EXPECTF--
! 93: *** Testing imap_close() : usage variations ***
! 94:
! 95: -- Iteration 1 --
! 96:
! 97: Warning: imap_close() expects parameter 1 to be resource, integer given in %simap_close_variation1.php on line 80
! 98: NULL
! 99:
! 100: -- Iteration 2 --
! 101:
! 102: Warning: imap_close() expects parameter 1 to be resource, integer given in %simap_close_variation1.php on line 80
! 103: NULL
! 104:
! 105: -- Iteration 3 --
! 106:
! 107: Warning: imap_close() expects parameter 1 to be resource, integer given in %simap_close_variation1.php on line 80
! 108: NULL
! 109:
! 110: -- Iteration 4 --
! 111:
! 112: Warning: imap_close() expects parameter 1 to be resource, integer given in %simap_close_variation1.php on line 80
! 113: NULL
! 114:
! 115: -- Iteration 5 --
! 116:
! 117: Warning: imap_close() expects parameter 1 to be resource, double given in %simap_close_variation1.php on line 80
! 118: NULL
! 119:
! 120: -- Iteration 6 --
! 121:
! 122: Warning: imap_close() expects parameter 1 to be resource, double given in %simap_close_variation1.php on line 80
! 123: NULL
! 124:
! 125: -- Iteration 7 --
! 126:
! 127: Warning: imap_close() expects parameter 1 to be resource, double given in %simap_close_variation1.php on line 80
! 128: NULL
! 129:
! 130: -- Iteration 8 --
! 131:
! 132: Warning: imap_close() expects parameter 1 to be resource, double given in %simap_close_variation1.php on line 80
! 133: NULL
! 134:
! 135: -- Iteration 9 --
! 136:
! 137: Warning: imap_close() expects parameter 1 to be resource, double given in %simap_close_variation1.php on line 80
! 138: NULL
! 139:
! 140: -- Iteration 10 --
! 141:
! 142: Warning: imap_close() expects parameter 1 to be resource, null given in %simap_close_variation1.php on line 80
! 143: NULL
! 144:
! 145: -- Iteration 11 --
! 146:
! 147: Warning: imap_close() expects parameter 1 to be resource, null given in %simap_close_variation1.php on line 80
! 148: NULL
! 149:
! 150: -- Iteration 12 --
! 151:
! 152: Warning: imap_close() expects parameter 1 to be resource, boolean given in %simap_close_variation1.php on line 80
! 153: NULL
! 154:
! 155: -- Iteration 13 --
! 156:
! 157: Warning: imap_close() expects parameter 1 to be resource, boolean given in %simap_close_variation1.php on line 80
! 158: NULL
! 159:
! 160: -- Iteration 14 --
! 161:
! 162: Warning: imap_close() expects parameter 1 to be resource, boolean given in %simap_close_variation1.php on line 80
! 163: NULL
! 164:
! 165: -- Iteration 15 --
! 166:
! 167: Warning: imap_close() expects parameter 1 to be resource, boolean given in %simap_close_variation1.php on line 80
! 168: NULL
! 169:
! 170: -- Iteration 16 --
! 171:
! 172: Warning: imap_close() expects parameter 1 to be resource, %unicode_string_optional% given in %simap_close_variation1.php on line 80
! 173: NULL
! 174:
! 175: -- Iteration 17 --
! 176:
! 177: Warning: imap_close() expects parameter 1 to be resource, %unicode_string_optional% given in %simap_close_variation1.php on line 80
! 178: NULL
! 179:
! 180: -- Iteration 18 --
! 181:
! 182: Warning: imap_close() expects parameter 1 to be resource, array given in %simap_close_variation1.php on line 80
! 183: NULL
! 184:
! 185: -- Iteration 19 --
! 186:
! 187: Warning: imap_close() expects parameter 1 to be resource, %unicode_string_optional% given in %simap_close_variation1.php on line 80
! 188: NULL
! 189:
! 190: -- Iteration 20 --
! 191:
! 192: Warning: imap_close() expects parameter 1 to be resource, %unicode_string_optional% given in %simap_close_variation1.php on line 80
! 193: NULL
! 194:
! 195: -- Iteration 21 --
! 196:
! 197: Warning: imap_close() expects parameter 1 to be resource, %unicode_string_optional% given in %simap_close_variation1.php on line 80
! 198: NULL
! 199:
! 200: -- Iteration 22 --
! 201:
! 202: Warning: imap_close() expects parameter 1 to be resource, object given in %simap_close_variation1.php on line 80
! 203: NULL
! 204:
! 205: -- Iteration 23 --
! 206:
! 207: Warning: imap_close() expects parameter 1 to be resource, null given in %simap_close_variation1.php on line 80
! 208: NULL
! 209:
! 210: -- Iteration 24 --
! 211:
! 212: Warning: imap_close() expects parameter 1 to be resource, null given in %simap_close_variation1.php on line 80
! 213: NULL
! 214: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>