From: Antony Dovgal Date: Thu, 8 Dec 2005 22:31:55 +0000 (+0000) Subject: add new tests X-Git-Tag: RELEASE_1_0_4~459 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8338c39ff31aeca26236af55eba25a208b09bcff;p=php add new tests --- diff --git a/ext/oci8/tests/array_bind_001.phpt b/ext/oci8/tests/array_bind_001.phpt new file mode 100644 index 0000000000..1310325ad4 --- /dev/null +++ b/ext/oci8/tests/array_bind_001.phpt @@ -0,0 +1,69 @@ +--TEST-- +oci_bind_array_by_name() and invalid values 1 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_bind_array_by_name(): OCI-21560: argument 3 is null, invalid, or out of range in %s on line %d + +Warning: oci_execute(): ORA-01008: not all variables bound in %s on line %d +array(1) { + [0]=> + string(0) "" +} +Done diff --git a/ext/oci8/tests/array_bind_002.phpt b/ext/oci8/tests/array_bind_002.phpt new file mode 100644 index 0000000000..4c76df42f9 --- /dev/null +++ b/ext/oci8/tests/array_bind_002.phpt @@ -0,0 +1,77 @@ +--TEST-- +oci_bind_array_by_name() and invalid values 2 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_bind_array_by_name(): Maximum array length must be greater than zero in %s on line %d + +Warning: oci_execute(): ORA-01008: not all variables bound in %s on line %d +array(5) { + [0]=> + string(9) "06-DEC-05" + [1]=> + string(9) "10-DEC-80" + [2]=> + string(9) "21-AUG-91" + [3]=> + string(9) "26-OCT-17" + [4]=> + string(9) "05-NOV-05" +} +Done diff --git a/ext/oci8/tests/array_bind_003.phpt b/ext/oci8/tests/array_bind_003.phpt new file mode 100644 index 0000000000..497e46e496 --- /dev/null +++ b/ext/oci8/tests/array_bind_003.phpt @@ -0,0 +1,73 @@ +--TEST-- +oci_bind_array_by_name() and invalid values 3 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_execute(): OCI_NO_DATA in %s on line %d +array(4) { + [0]=> + string(9) "06-DEC-05" + [1]=> + string(9) "10-DEC-80" + [2]=> + string(9) "21-AUG-91" + [3]=> + string(9) "26-OCT-17" +} +Done diff --git a/ext/oci8/tests/array_bind_004.phpt b/ext/oci8/tests/array_bind_004.phpt new file mode 100644 index 0000000000..1ddf85149b --- /dev/null +++ b/ext/oci8/tests/array_bind_004.phpt @@ -0,0 +1,65 @@ +--TEST-- +oci_bind_array_by_name() and invalid values 4 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_execute(): OCI_NO_DATA in %s on line %d +array(0) { +} +Done diff --git a/ext/oci8/tests/array_bind_005.phpt b/ext/oci8/tests/array_bind_005.phpt new file mode 100644 index 0000000000..192d15563d --- /dev/null +++ b/ext/oci8/tests/array_bind_005.phpt @@ -0,0 +1,74 @@ +--TEST-- +oci_bind_array_by_name() and invalid values 5 +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(5) { + [0]=> + string(0) "" + [1]=> + string(0) "" + [2]=> + string(0) "" + [3]=> + string(0) "" + [4]=> + string(0) "" +} +Done diff --git a/ext/oci8/tests/array_bind_006.phpt b/ext/oci8/tests/array_bind_006.phpt new file mode 100644 index 0000000000..e229dd8722 --- /dev/null +++ b/ext/oci8/tests/array_bind_006.phpt @@ -0,0 +1,74 @@ +--TEST-- +oci_bind_array_by_name(), SQLT_CHR and default max_length +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(5) { + [0]=> + string(4) "five" + [1]=> + string(4) "four" + [2]=> + string(5) "three" + [3]=> + string(3) "two" + [4]=> + string(3) "one" +} +Done diff --git a/ext/oci8/tests/array_bind_007.phpt b/ext/oci8/tests/array_bind_007.phpt new file mode 100644 index 0000000000..10c92a8e7d --- /dev/null +++ b/ext/oci8/tests/array_bind_007.phpt @@ -0,0 +1,77 @@ +--TEST-- +oci_bind_array_by_name() and invalid values 7 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_bind_array_by_name(): Unknown or unsupported datatype given: -1 in %s on line %d + +Warning: oci_execute(): ORA-01008: not all variables bound in %s on line %d +array(5) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) +} +Done diff --git a/ext/oci8/tests/array_bind_008.phpt b/ext/oci8/tests/array_bind_008.phpt new file mode 100644 index 0000000000..c44304c11c --- /dev/null +++ b/ext/oci8/tests/array_bind_008.phpt @@ -0,0 +1,78 @@ +--TEST-- +oci_bind_array_by_name() and invalid values 8 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_execute(): ORA-06550: line %d, column %d: +PLS-00418: array bind type must match PL/SQL table row type +ORA-06550: line %d, column %d: +PL/SQL: Statement ignored in %s on line %d +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "2" + [2]=> + string(1) "3" + [3]=> + string(1) "4" + [4]=> + string(1) "5" +} +Done diff --git a/ext/oci8/tests/array_bind_009.phpt b/ext/oci8/tests/array_bind_009.phpt new file mode 100644 index 0000000000..8e83b0982c --- /dev/null +++ b/ext/oci8/tests/array_bind_009.phpt @@ -0,0 +1,17 @@ +--TEST-- +oci_bind_array_by_name() and invalid values 9 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_bind_array_by_name(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) +Done diff --git a/ext/oci8/tests/array_bind_010.phpt b/ext/oci8/tests/array_bind_010.phpt new file mode 100644 index 0000000000..a77ed913ea --- /dev/null +++ b/ext/oci8/tests/array_bind_010.phpt @@ -0,0 +1,36 @@ +--TEST-- +oci_bind_array_by_name() and invalid values 8 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_bind_array_by_name(): ORA-01036: illegal variable name/number in %s on line %d +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "2" + [2]=> + string(1) "3" + [3]=> + string(1) "4" + [4]=> + string(1) "5" +} +Done diff --git a/ext/oci8/tests/array_bind_011.phpt b/ext/oci8/tests/array_bind_011.phpt new file mode 100644 index 0000000000..e8e00a8091 --- /dev/null +++ b/ext/oci8/tests/array_bind_011.phpt @@ -0,0 +1,67 @@ +--TEST-- +oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d + +Warning: oci_execute(): ORA-01008: not all variables bound in %s on line %d +array(0) { +} +Done diff --git a/ext/oci8/tests/array_bind_012.phpt b/ext/oci8/tests/array_bind_012.phpt new file mode 100644 index 0000000000..2208f0b3b9 --- /dev/null +++ b/ext/oci8/tests/array_bind_012.phpt @@ -0,0 +1,26 @@ +--TEST-- +oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_bind_array_by_name(): Invalid max length value (-10) in %s on line %d +array(0) { +} +Done diff --git a/ext/oci8/tests/array_bind_date1.phpt b/ext/oci8/tests/array_bind_date1.phpt new file mode 100644 index 0000000000..ebf767570b --- /dev/null +++ b/ext/oci8/tests/array_bind_date1.phpt @@ -0,0 +1,74 @@ +--TEST-- +oci_bind_array_by_name() and SQLT_ODT +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(5) { + [0]=> + string(9) "05-NOV-05" + [1]=> + string(9) "26-OCT-17" + [2]=> + string(9) "21-AUG-91" + [3]=> + string(9) "10-DEC-80" + [4]=> + string(9) "06-DEC-05" +} +Done diff --git a/ext/oci8/tests/array_bind_float1.phpt b/ext/oci8/tests/array_bind_float1.phpt new file mode 100644 index 0000000000..ead85890fa --- /dev/null +++ b/ext/oci8/tests/array_bind_float1.phpt @@ -0,0 +1,74 @@ +--TEST-- +oci_bind_array_by_name() and SQLT_FLT +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(5) { + [0]=> + float(5.9999) + [1]=> + float(4.2123) + [2]=> + float(3.4234) + [3]=> + float(2.5658) + [4]=> + float(1.243) +} +Done diff --git a/ext/oci8/tests/array_bind_int1.phpt b/ext/oci8/tests/array_bind_int1.phpt new file mode 100644 index 0000000000..eb2072adcf --- /dev/null +++ b/ext/oci8/tests/array_bind_int1.phpt @@ -0,0 +1,74 @@ +--TEST-- +oci_bind_array_by_name() and SQLT_INT +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(5) { + [0]=> + int(5) + [1]=> + int(4) + [2]=> + int(3) + [3]=> + int(2) + [4]=> + int(1) +} +Done diff --git a/ext/oci8/tests/array_bind_str1.phpt b/ext/oci8/tests/array_bind_str1.phpt new file mode 100644 index 0000000000..af4dbfe220 --- /dev/null +++ b/ext/oci8/tests/array_bind_str1.phpt @@ -0,0 +1,74 @@ +--TEST-- +oci_bind_array_by_name() and SQLT_AVC +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(5) { + [0]=> + string(4) "five" + [1]=> + string(4) "four" + [2]=> + string(5) "three" + [3]=> + string(3) "two" + [4]=> + string(3) "one" +} +Done diff --git a/ext/oci8/tests/execute_mode.phpt b/ext/oci8/tests/execute_mode.phpt new file mode 100644 index 0000000000..90570cae80 --- /dev/null +++ b/ext/oci8/tests/execute_mode.phpt @@ -0,0 +1,19 @@ +--TEST-- +oci_execute() and invalid execute mode +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: oci_execute(): Invalid execute mode given: -1 in %s on line %d +Done diff --git a/ext/oci8/tests/field_funcs1.phpt b/ext/oci8/tests/field_funcs1.phpt new file mode 100644 index 0000000000..68986e051f --- /dev/null +++ b/ext/oci8/tests/field_funcs1.phpt @@ -0,0 +1,179 @@ +--TEST-- +oci_field_*() family +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} + +Warning: oci_field_is_null(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_name(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_type(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_scale(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_precision(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_size(): Invalid column index "-1" in %s on line %d +bool(false) + +Warning: oci_field_is_null(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_name(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_type(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_scale(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_precision(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_size(): Invalid column name "none" in %s on line %d +bool(false) + +Warning: oci_field_is_null(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_name(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_type(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_scale(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_precision(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_size(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) + +Warning: oci_field_is_null(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_name(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_type(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_type_raw(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_scale(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_precision(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_size(): Invalid column index "0" in %s on line %d +bool(false) + +Warning: oci_field_size() expects exactly 2 parameters, 1 given in %s on line %d +bool(false) +Done diff --git a/ext/oci8/tests/select_null.phpt b/ext/oci8/tests/select_null.phpt new file mode 100644 index 0000000000..20307b3e29 --- /dev/null +++ b/ext/oci8/tests/select_null.phpt @@ -0,0 +1,23 @@ +--TEST-- +SELECTing NULL values +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + NULL +} +Done