Annotation of embedaddon/php/ext/xml/tests/xml_set_processing_instruction_handler_variation1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test xml_set_processing_instruction_handler() function : usage variations
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded("xml")) {
! 6: print "skip - XML extension not loaded";
! 7: }
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: /* Prototype : proto int xml_set_processing_instruction_handler(resource parser, string hdl)
! 12: * Description: Set up processing instruction (PI) handler
! 13: * Source code: ext/xml/xml.c
! 14: * Alias to functions:
! 15: */
! 16:
! 17: echo "*** Testing xml_set_processing_instruction_handler() : usage variations ***\n";
! 18: error_reporting(E_ALL & ~E_NOTICE);
! 19:
! 20: class aClass {
! 21: function __toString() {
! 22: return "Some Ascii Data";
! 23: }
! 24: }
! 25:
! 26: function validHandler(resource $parser ,string $data) {
! 27: }
! 28:
! 29: // Initialise function arguments not being substituted (if any)
! 30: $hdl = 'validHandler';
! 31:
! 32: //get an unset variable
! 33: $unset_var = 10;
! 34: unset ($unset_var);
! 35:
! 36: $fp = fopen(__FILE__, "r");
! 37:
! 38: //array of values to iterate over
! 39: $values = array(
! 40:
! 41: // int data
! 42: 0,
! 43: 1,
! 44: 12345,
! 45: -2345,
! 46:
! 47: // float data
! 48: 10.5,
! 49: -10.5,
! 50: 10.1234567e10,
! 51: 10.7654321E-10,
! 52: .5,
! 53:
! 54: // array data
! 55: array(),
! 56: array(0),
! 57: array(1),
! 58: array(1, 2),
! 59: array('color' => 'red', 'item' => 'pen'),
! 60:
! 61: // null data
! 62: NULL,
! 63: null,
! 64:
! 65: // boolean data
! 66: true,
! 67: false,
! 68: TRUE,
! 69: FALSE,
! 70:
! 71: // empty data
! 72: "",
! 73: '',
! 74:
! 75: // string data
! 76: "string",
! 77: 'string',
! 78:
! 79: // object data
! 80: new aClass(),
! 81:
! 82: // resource data
! 83: $fp,
! 84:
! 85: // undefined data
! 86: $undefined_var,
! 87:
! 88: // unset data
! 89: $unset_var,
! 90: );
! 91:
! 92: // loop through each element of the array for parser
! 93:
! 94: foreach($values as $value) {
! 95: echo "\nArg value $value \n";
! 96: var_dump( xml_set_processing_instruction_handler($value, $hdl) );
! 97: };
! 98:
! 99: fclose($fp);
! 100: echo "Done";
! 101: ?>
! 102: --EXPECTF--
! 103: *** Testing xml_set_processing_instruction_handler() : usage variations ***
! 104:
! 105: Arg value 0
! 106:
! 107: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, integer given in %s on line %d
! 108: NULL
! 109:
! 110: Arg value 1
! 111:
! 112: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, integer given in %s on line %d
! 113: NULL
! 114:
! 115: Arg value 12345
! 116:
! 117: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, integer given in %s on line %d
! 118: NULL
! 119:
! 120: Arg value -2345
! 121:
! 122: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, integer given in %s on line %d
! 123: NULL
! 124:
! 125: Arg value 10.5
! 126:
! 127: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, double given in %s on line %d
! 128: NULL
! 129:
! 130: Arg value -10.5
! 131:
! 132: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, double given in %s on line %d
! 133: NULL
! 134:
! 135: Arg value 101234567000
! 136:
! 137: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, double given in %s on line %d
! 138: NULL
! 139:
! 140: Arg value 1.07654321E-9
! 141:
! 142: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, double given in %s on line %d
! 143: NULL
! 144:
! 145: Arg value 0.5
! 146:
! 147: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, double given in %s on line %d
! 148: NULL
! 149:
! 150: Arg value Array
! 151:
! 152: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, array given in %s on line %d
! 153: NULL
! 154:
! 155: Arg value Array
! 156:
! 157: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, array given in %s on line %d
! 158: NULL
! 159:
! 160: Arg value Array
! 161:
! 162: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, array given in %s on line %d
! 163: NULL
! 164:
! 165: Arg value Array
! 166:
! 167: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, array given in %s on line %d
! 168: NULL
! 169:
! 170: Arg value Array
! 171:
! 172: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, array given in %s on line %d
! 173: NULL
! 174:
! 175: Arg value
! 176:
! 177: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, null given in %s on line %d
! 178: NULL
! 179:
! 180: Arg value
! 181:
! 182: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, null given in %s on line %d
! 183: NULL
! 184:
! 185: Arg value 1
! 186:
! 187: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, boolean given in %s on line %d
! 188: NULL
! 189:
! 190: Arg value
! 191:
! 192: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, boolean given in %s on line %d
! 193: NULL
! 194:
! 195: Arg value 1
! 196:
! 197: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, boolean given in %s on line %d
! 198: NULL
! 199:
! 200: Arg value
! 201:
! 202: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, boolean given in %s on line %d
! 203: NULL
! 204:
! 205: Arg value
! 206:
! 207: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, string given in %s on line %d
! 208: NULL
! 209:
! 210: Arg value
! 211:
! 212: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, string given in %s on line %d
! 213: NULL
! 214:
! 215: Arg value string
! 216:
! 217: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, string given in %s on line %d
! 218: NULL
! 219:
! 220: Arg value string
! 221:
! 222: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, string given in %s on line %d
! 223: NULL
! 224:
! 225: Arg value Some Ascii Data
! 226:
! 227: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, object given in %s on line %d
! 228: NULL
! 229:
! 230: Arg value Resource id %s
! 231:
! 232: Warning: xml_set_processing_instruction_handler(): supplied resource is not a valid XML Parser resource in %s on line %d
! 233: bool(false)
! 234:
! 235: Arg value
! 236:
! 237: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, null given in %s on line %d
! 238: NULL
! 239:
! 240: Arg value
! 241:
! 242: Warning: xml_set_processing_instruction_handler() expects parameter 1 to be resource, null given in %s on line %d
! 243: NULL
! 244: Done
! 245:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>