Annotation of embedaddon/php/ext/posix/tests/posix_kill_variation2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test posix_kill() function : usage variations - second parameter type
! 3: --SKIPIF--
! 4: <?php
! 5: if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
! 6: ?>
! 7: --FILE--
! 8: <?php
! 9: /* Prototype : proto bool posix_kill(int pid, int sig)
! 10: * Description: Send a signal to a process (POSIX.1, 3.3.2)
! 11: * Source code: ext/posix/posix.c
! 12: * Alias to functions:
! 13: */
! 14:
! 15: echo "*** Testing posix_kill() : usage variations ***\n";
! 16:
! 17: // Initialise function arguments not being substituted (if any)
! 18: $pid = -999;
! 19:
! 20: //get an unset variable
! 21: $unset_var = 10;
! 22: unset ($unset_var);
! 23:
! 24: //array of values to iterate over
! 25: $values = array(
! 26:
! 27: // float data
! 28: 10.5,
! 29: -10.5,
! 30: 10.1234567e10,
! 31: 10.7654321E-10,
! 32: .5,
! 33:
! 34: // array data
! 35: array(),
! 36: array(0),
! 37: array(1),
! 38: array(1, 2),
! 39: array('color' => 'red', 'item' => 'pen'),
! 40:
! 41: // null data
! 42: NULL,
! 43: null,
! 44:
! 45: // boolean data
! 46: true,
! 47: false,
! 48: TRUE,
! 49: FALSE,
! 50:
! 51: // empty data
! 52: "",
! 53: '',
! 54:
! 55: // string data
! 56: "string",
! 57: 'string',
! 58:
! 59: // undefined data
! 60: $undefined_var,
! 61:
! 62: // unset data
! 63: $unset_var,
! 64:
! 65: // object data
! 66: new stdclass(),
! 67: );
! 68:
! 69: // loop through each element of the array for sig
! 70:
! 71: foreach($values as $value) {
! 72: echo "\nArg value $value \n";
! 73: var_dump( posix_kill($pid, $value) );
! 74: };
! 75:
! 76: echo "Done";
! 77: ?>
! 78: --EXPECTF--
! 79: *** Testing posix_kill() : usage variations ***
! 80:
! 81: Notice: Undefined variable: undefined_var in %s on line %d
! 82:
! 83: Notice: Undefined variable: unset_var in %s on line %d
! 84:
! 85: Arg value 10.5
! 86: bool(false)
! 87:
! 88: Arg value -10.5
! 89: bool(false)
! 90:
! 91: Arg value 101234567000
! 92: bool(false)
! 93:
! 94: Arg value 1.07654321E-9
! 95: bool(false)
! 96:
! 97: Arg value 0.5
! 98: bool(false)
! 99:
! 100: Arg value Array
! 101:
! 102: Warning: posix_kill() expects parameter 2 to be long, array given in %s on line %d
! 103: bool(false)
! 104:
! 105: Arg value Array
! 106:
! 107: Warning: posix_kill() expects parameter 2 to be long, array given in %s on line %d
! 108: bool(false)
! 109:
! 110: Arg value Array
! 111:
! 112: Warning: posix_kill() expects parameter 2 to be long, array given in %s on line %d
! 113: bool(false)
! 114:
! 115: Arg value Array
! 116:
! 117: Warning: posix_kill() expects parameter 2 to be long, array given in %s on line %d
! 118: bool(false)
! 119:
! 120: Arg value Array
! 121:
! 122: Warning: posix_kill() expects parameter 2 to be long, array given in %s on line %d
! 123: bool(false)
! 124:
! 125: Arg value
! 126: bool(false)
! 127:
! 128: Arg value
! 129: bool(false)
! 130:
! 131: Arg value 1
! 132: bool(false)
! 133:
! 134: Arg value
! 135: bool(false)
! 136:
! 137: Arg value 1
! 138: bool(false)
! 139:
! 140: Arg value
! 141: bool(false)
! 142:
! 143: Arg value
! 144:
! 145: Warning: posix_kill() expects parameter 2 to be long, string given in %s on line %d
! 146: bool(false)
! 147:
! 148: Arg value
! 149:
! 150: Warning: posix_kill() expects parameter 2 to be long, string given in %s on line %d
! 151: bool(false)
! 152:
! 153: Arg value string
! 154:
! 155: Warning: posix_kill() expects parameter 2 to be long, string given in %s on line %d
! 156: bool(false)
! 157:
! 158: Arg value string
! 159:
! 160: Warning: posix_kill() expects parameter 2 to be long, string given in %s on line %d
! 161: bool(false)
! 162:
! 163: Arg value
! 164: bool(false)
! 165:
! 166: Arg value
! 167: bool(false)
! 168:
! 169: Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>