Annotation of embedaddon/php/ext/oci8/tests/field_funcs1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: oci_field_*() family: error cases
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: require(dirname(__FILE__)."/connect.inc");
! 9:
! 10: // Initialize
! 11:
! 12: $stmtarray = array(
! 13: "drop table field_funcs1_tab",
! 14: "create table field_funcs1_tab (id number, value number)",
! 15: "insert into field_funcs1_tab (id, value) values (1,1)",
! 16: "insert into field_funcs1_tab (id, value) values (1,1)",
! 17: "insert into field_funcs1_tab (id, value) values (1,1)"
! 18: );
! 19:
! 20: oci8_test_sql_execute($c, $stmtarray);
! 21:
! 22: // Run Test
! 23:
! 24: if (!($s = oci_parse($c, "select * from field_funcs1_tab"))) {
! 25: die("oci_parse(select) failed!\n");
! 26: }
! 27:
! 28: if (!oci_execute($s)) {
! 29: die("oci_execute(select) failed!\n");
! 30: }
! 31:
! 32: $row = oci_fetch_array($s, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS);
! 33: var_dump($row);
! 34:
! 35: echo "Test 1\n";
! 36: var_dump(oci_field_is_null($s, -1));
! 37: var_dump(oci_field_name($s, -1));
! 38: var_dump(oci_field_type($s, -1));
! 39: var_dump(oci_field_type_raw($s, -1));
! 40: var_dump(oci_field_scale($s, -1));
! 41: var_dump(oci_field_precision($s, -1));
! 42: var_dump(oci_field_size($s, -1));
! 43:
! 44: echo "Test 2\n";
! 45: var_dump(oci_field_is_null($s, "none"));
! 46: var_dump(oci_field_name($s, "none"));
! 47: var_dump(oci_field_type($s, "none"));
! 48: var_dump(oci_field_type_raw($s, "none"));
! 49: var_dump(oci_field_scale($s, "none"));
! 50: var_dump(oci_field_precision($s, "none"));
! 51: var_dump(oci_field_size($s, "none"));
! 52:
! 53: echo "Test 3\n";
! 54: var_dump(oci_field_is_null($c, -1));
! 55: var_dump(oci_field_name($c, -1));
! 56: var_dump(oci_field_type($c, -1));
! 57: var_dump(oci_field_type_raw($c, -1));
! 58: var_dump(oci_field_scale($c, -1));
! 59: var_dump(oci_field_precision($c, -1));
! 60: var_dump(oci_field_size($c, -1));
! 61:
! 62: echo "Test 4\n";
! 63: var_dump(oci_field_is_null($s, array()));
! 64: var_dump(oci_field_name($s, array()));
! 65: var_dump(oci_field_type($s, array()));
! 66: var_dump(oci_field_type_raw($s, array()));
! 67: var_dump(oci_field_scale($s, array()));
! 68: var_dump(oci_field_precision($s, array()));
! 69: var_dump(oci_field_size($s, array()));
! 70:
! 71: var_dump(oci_field_size($s));
! 72:
! 73:
! 74: // Cleanup
! 75:
! 76: $stmtarray = array(
! 77: "drop table field_funcs1_tab"
! 78: );
! 79:
! 80: oci8_test_sql_execute($c, $stmtarray);
! 81:
! 82: echo "Done\n";
! 83:
! 84: ?>
! 85: --EXPECTF--
! 86: array(2) {
! 87: [0]=>
! 88: %unicode|string%(1) "1"
! 89: [1]=>
! 90: %unicode|string%(1) "1"
! 91: }
! 92: Test 1
! 93:
! 94: Warning: oci_field_is_null(): Invalid column index "-1" in %s on line %d
! 95: bool(false)
! 96:
! 97: Warning: oci_field_name(): Invalid column index "-1" in %s on line %d
! 98: bool(false)
! 99:
! 100: Warning: oci_field_type(): Invalid column index "-1" in %s on line %d
! 101: bool(false)
! 102:
! 103: Warning: oci_field_type_raw(): Invalid column index "-1" in %s on line %d
! 104: bool(false)
! 105:
! 106: Warning: oci_field_scale(): Invalid column index "-1" in %s on line %d
! 107: bool(false)
! 108:
! 109: Warning: oci_field_precision(): Invalid column index "-1" in %s on line %d
! 110: bool(false)
! 111:
! 112: Warning: oci_field_size(): Invalid column index "-1" in %s on line %d
! 113: bool(false)
! 114: Test 2
! 115:
! 116: Warning: oci_field_is_null(): Invalid column name "none" in %s on line %d
! 117: bool(false)
! 118:
! 119: Warning: oci_field_name(): Invalid column name "none" in %s on line %d
! 120: bool(false)
! 121:
! 122: Warning: oci_field_type(): Invalid column name "none" in %s on line %d
! 123: bool(false)
! 124:
! 125: Warning: oci_field_type_raw(): Invalid column name "none" in %s on line %d
! 126: bool(false)
! 127:
! 128: Warning: oci_field_scale(): Invalid column name "none" in %s on line %d
! 129: bool(false)
! 130:
! 131: Warning: oci_field_precision(): Invalid column name "none" in %s on line %d
! 132: bool(false)
! 133:
! 134: Warning: oci_field_size(): Invalid column name "none" in %s on line %d
! 135: bool(false)
! 136: Test 3
! 137:
! 138: Warning: oci_field_is_null(): supplied resource is not a valid oci8 statement resource in %s on line %d
! 139: bool(false)
! 140:
! 141: Warning: oci_field_name(): supplied resource is not a valid oci8 statement resource in %s on line %d
! 142: bool(false)
! 143:
! 144: Warning: oci_field_type(): supplied resource is not a valid oci8 statement resource in %s on line %d
! 145: bool(false)
! 146:
! 147: Warning: oci_field_type_raw(): supplied resource is not a valid oci8 statement resource in %s on line %d
! 148: bool(false)
! 149:
! 150: Warning: oci_field_scale(): supplied resource is not a valid oci8 statement resource in %s on line %d
! 151: bool(false)
! 152:
! 153: Warning: oci_field_precision(): supplied resource is not a valid oci8 statement resource in %s on line %d
! 154: bool(false)
! 155:
! 156: Warning: oci_field_size(): supplied resource is not a valid oci8 statement resource in %s on line %d
! 157: bool(false)
! 158: Test 4
! 159:
! 160: Warning: oci_field_is_null(): Invalid column index "0" in %s on line %d
! 161: bool(false)
! 162:
! 163: Warning: oci_field_name(): Invalid column index "0" in %s on line %d
! 164: bool(false)
! 165:
! 166: Warning: oci_field_type(): Invalid column index "0" in %s on line %d
! 167: bool(false)
! 168:
! 169: Warning: oci_field_type_raw(): Invalid column index "0" in %s on line %d
! 170: bool(false)
! 171:
! 172: Warning: oci_field_scale(): Invalid column index "0" in %s on line %d
! 173: bool(false)
! 174:
! 175: Warning: oci_field_precision(): Invalid column index "0" in %s on line %d
! 176: bool(false)
! 177:
! 178: Warning: oci_field_size(): Invalid column index "0" in %s on line %d
! 179: bool(false)
! 180:
! 181: Warning: oci_field_size() expects exactly 2 parameters, 1 given in %s on line %d
! 182: bool(false)
! 183: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>