From: Antony Dovgal Date: Tue, 6 Sep 2005 19:33:18 +0000 (+0000) Subject: new tests X-Git-Tag: RELEASE_0_9_0~283 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0ed2b45ffc89b3b89746be4c0743d0710abde85;p=php new tests --- diff --git a/ext/oci8/tests/bug26133.phpt b/ext/oci8/tests/bug26133.phpt index d3f0ed9bf3..a0492cfde6 100644 --- a/ext/oci8/tests/bug26133.phpt +++ b/ext/oci8/tests/bug26133.phpt @@ -1,36 +1,39 @@ --TEST-- Bug #26133 (ocifreedesc() segfault) --SKIPIF-- - + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; --FILE-- free(); } - require 'drop_table.inc'; + require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Done - diff --git a/ext/oci8/tests/bug27303.phpt b/ext/oci8/tests/bug27303.phpt new file mode 100644 index 0000000000..22a1f6d717 --- /dev/null +++ b/ext/oci8/tests/bug27303.phpt @@ -0,0 +1,257 @@ +--TEST-- +bug #27303 (OCIBindByName binds numeric PHP values as characters) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +string(1) "1" +string(1) "2" +string(1) "3" +string(1) "4" +string(1) "5" +string(1) "6" +string(1) "7" +string(1) "8" +string(1) "9" +string(2) "10" +string(2) "11" +string(2) "12" +string(2) "13" +string(2) "14" +string(2) "15" +string(2) "16" +string(2) "17" +string(2) "18" +string(2) "19" +string(2) "20" +string(2) "21" +string(2) "22" +string(2) "23" +string(2) "24" +string(2) "25" +string(2) "26" +string(2) "27" +string(2) "28" +string(2) "29" +string(2) "30" +string(2) "31" +string(2) "32" +string(2) "33" +string(2) "34" +string(2) "35" +string(2) "36" +string(2) "37" +string(2) "38" +string(2) "39" +string(2) "40" +string(2) "41" +string(2) "42" +string(2) "43" +string(2) "44" +string(2) "45" +string(2) "46" +string(2) "47" +string(2) "48" +string(2) "49" +string(2) "50" +string(2) "51" +string(2) "52" +string(2) "53" +string(2) "54" +string(2) "55" +string(2) "56" +string(2) "57" +string(2) "58" +string(2) "59" +string(2) "60" +string(2) "61" +string(2) "62" +string(2) "63" +string(2) "64" +string(2) "65" +string(2) "66" +string(2) "67" +string(2) "68" +string(2) "69" +string(2) "70" +string(2) "71" +string(2) "72" +string(2) "73" +string(2) "74" +string(2) "75" +string(2) "76" +string(2) "77" +string(2) "78" +string(2) "79" +string(2) "80" +string(2) "81" +string(2) "82" +string(2) "83" +string(2) "84" +string(2) "85" +string(2) "86" +string(2) "87" +string(2) "88" +string(2) "89" +string(2) "90" +string(2) "91" +string(2) "92" +string(2) "93" +string(2) "94" +string(2) "95" +string(2) "96" +string(2) "97" +string(2) "98" +string(2) "99" +string(3) "100" +string(3) "101" +string(3) "102" +string(3) "103" +string(3) "104" +string(3) "105" +string(3) "106" +string(3) "107" +string(3) "108" +string(3) "109" +string(3) "110" +string(3) "111" +string(3) "112" +string(3) "113" +string(3) "114" +string(3) "115" +string(3) "116" +string(3) "117" +string(3) "118" +string(3) "119" +string(3) "120" +string(3) "121" +string(3) "122" +string(3) "123" +string(3) "124" +string(3) "125" +string(3) "126" +string(3) "127" +string(3) "128" +string(3) "129" +string(3) "130" +string(3) "131" +string(3) "132" +string(3) "133" +string(3) "134" +string(3) "135" +string(3) "136" +string(3) "137" +string(3) "138" +string(3) "139" +string(3) "140" +string(3) "141" +string(3) "142" +string(3) "143" +string(3) "144" +string(3) "145" +string(3) "146" +string(3) "147" +string(3) "148" +string(3) "149" +string(3) "150" +string(3) "151" +string(3) "152" +string(3) "153" +string(3) "154" +string(3) "155" +string(3) "156" +string(3) "157" +string(3) "158" +string(3) "159" +string(3) "160" +string(3) "161" +string(3) "162" +string(3) "163" +string(3) "164" +string(3) "165" +string(3) "166" +string(3) "167" +string(3) "168" +string(3) "169" +string(3) "170" +string(3) "171" +string(3) "172" +string(3) "173" +string(3) "174" +string(3) "175" +string(3) "176" +string(3) "177" +string(3) "178" +string(3) "179" +string(3) "180" +string(3) "181" +string(3) "182" +string(3) "183" +string(3) "184" +string(3) "185" +string(3) "186" +string(3) "187" +string(3) "188" +string(3) "189" +string(3) "190" +string(3) "191" +string(3) "192" +string(3) "193" +string(3) "194" +string(3) "195" +string(3) "196" +string(3) "197" +string(3) "198" +string(3) "199" +Done diff --git a/ext/oci8/tests/bug27303_2.phpt b/ext/oci8/tests/bug27303_2.phpt new file mode 100644 index 0000000000..39c7c1099a --- /dev/null +++ b/ext/oci8/tests/bug27303_2.phpt @@ -0,0 +1,257 @@ +--TEST-- +bug #27303 (OCIBindByName binds numeric PHP values as characters) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +string(1) "1" +string(1) "2" +string(1) "3" +string(1) "4" +string(1) "5" +string(1) "6" +string(1) "7" +string(1) "8" +string(1) "9" +string(2) "10" +string(2) "11" +string(2) "12" +string(2) "13" +string(2) "14" +string(2) "15" +string(2) "16" +string(2) "17" +string(2) "18" +string(2) "19" +string(2) "20" +string(2) "21" +string(2) "22" +string(2) "23" +string(2) "24" +string(2) "25" +string(2) "26" +string(2) "27" +string(2) "28" +string(2) "29" +string(2) "30" +string(2) "31" +string(2) "32" +string(2) "33" +string(2) "34" +string(2) "35" +string(2) "36" +string(2) "37" +string(2) "38" +string(2) "39" +string(2) "40" +string(2) "41" +string(2) "42" +string(2) "43" +string(2) "44" +string(2) "45" +string(2) "46" +string(2) "47" +string(2) "48" +string(2) "49" +string(2) "50" +string(2) "51" +string(2) "52" +string(2) "53" +string(2) "54" +string(2) "55" +string(2) "56" +string(2) "57" +string(2) "58" +string(2) "59" +string(2) "60" +string(2) "61" +string(2) "62" +string(2) "63" +string(2) "64" +string(2) "65" +string(2) "66" +string(2) "67" +string(2) "68" +string(2) "69" +string(2) "70" +string(2) "71" +string(2) "72" +string(2) "73" +string(2) "74" +string(2) "75" +string(2) "76" +string(2) "77" +string(2) "78" +string(2) "79" +string(2) "80" +string(2) "81" +string(2) "82" +string(2) "83" +string(2) "84" +string(2) "85" +string(2) "86" +string(2) "87" +string(2) "88" +string(2) "89" +string(2) "90" +string(2) "91" +string(2) "92" +string(2) "93" +string(2) "94" +string(2) "95" +string(2) "96" +string(2) "97" +string(2) "98" +string(2) "99" +string(3) "100" +string(3) "101" +string(3) "102" +string(3) "103" +string(3) "104" +string(3) "105" +string(3) "106" +string(3) "107" +string(3) "108" +string(3) "109" +string(3) "110" +string(3) "111" +string(3) "112" +string(3) "113" +string(3) "114" +string(3) "115" +string(3) "116" +string(3) "117" +string(3) "118" +string(3) "119" +string(3) "120" +string(3) "121" +string(3) "122" +string(3) "123" +string(3) "124" +string(3) "125" +string(3) "126" +string(3) "127" +string(3) "128" +string(3) "129" +string(3) "130" +string(3) "131" +string(3) "132" +string(3) "133" +string(3) "134" +string(3) "135" +string(3) "136" +string(3) "137" +string(3) "138" +string(3) "139" +string(3) "140" +string(3) "141" +string(3) "142" +string(3) "143" +string(3) "144" +string(3) "145" +string(3) "146" +string(3) "147" +string(3) "148" +string(3) "149" +string(3) "150" +string(3) "151" +string(3) "152" +string(3) "153" +string(3) "154" +string(3) "155" +string(3) "156" +string(3) "157" +string(3) "158" +string(3) "159" +string(3) "160" +string(3) "161" +string(3) "162" +string(3) "163" +string(3) "164" +string(3) "165" +string(3) "166" +string(3) "167" +string(3) "168" +string(3) "169" +string(3) "170" +string(3) "171" +string(3) "172" +string(3) "173" +string(3) "174" +string(3) "175" +string(3) "176" +string(3) "177" +string(3) "178" +string(3) "179" +string(3) "180" +string(3) "181" +string(3) "182" +string(3) "183" +string(3) "184" +string(3) "185" +string(3) "186" +string(3) "187" +string(3) "188" +string(3) "189" +string(3) "190" +string(3) "191" +string(3) "192" +string(3) "193" +string(3) "194" +string(3) "195" +string(3) "196" +string(3) "197" +string(3) "198" +string(3) "199" +Done diff --git a/ext/oci8/tests/bug27303_3.phpt b/ext/oci8/tests/bug27303_3.phpt new file mode 100644 index 0000000000..137f907076 --- /dev/null +++ b/ext/oci8/tests/bug27303_3.phpt @@ -0,0 +1,257 @@ +--TEST-- +bug #27303 (OCIBindByName binds numeric PHP values as characters) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +int(1) +int(2) +int(3) +int(4) +int(5) +int(6) +int(7) +int(8) +int(9) +int(10) +int(11) +int(12) +int(13) +int(14) +int(15) +int(16) +int(17) +int(18) +int(19) +int(20) +int(21) +int(22) +int(23) +int(24) +int(25) +int(26) +int(27) +int(28) +int(29) +int(30) +int(31) +int(32) +int(33) +int(34) +int(35) +int(36) +int(37) +int(38) +int(39) +int(40) +int(41) +int(42) +int(43) +int(44) +int(45) +int(46) +int(47) +int(48) +int(49) +int(50) +int(51) +int(52) +int(53) +int(54) +int(55) +int(56) +int(57) +int(58) +int(59) +int(60) +int(61) +int(62) +int(63) +int(64) +int(65) +int(66) +int(67) +int(68) +int(69) +int(70) +int(71) +int(72) +int(73) +int(74) +int(75) +int(76) +int(77) +int(78) +int(79) +int(80) +int(81) +int(82) +int(83) +int(84) +int(85) +int(86) +int(87) +int(88) +int(89) +int(90) +int(91) +int(92) +int(93) +int(94) +int(95) +int(96) +int(97) +int(98) +int(99) +int(100) +int(101) +int(102) +int(103) +int(104) +int(105) +int(106) +int(107) +int(108) +int(109) +int(110) +int(111) +int(112) +int(113) +int(114) +int(115) +int(116) +int(117) +int(118) +int(119) +int(120) +int(121) +int(122) +int(123) +int(124) +int(125) +int(126) +int(127) +int(128) +int(129) +int(130) +int(131) +int(132) +int(133) +int(134) +int(135) +int(136) +int(137) +int(138) +int(139) +int(140) +int(141) +int(142) +int(143) +int(144) +int(145) +int(146) +int(147) +int(148) +int(149) +int(150) +int(151) +int(152) +int(153) +int(154) +int(155) +int(156) +int(157) +int(158) +int(159) +int(160) +int(161) +int(162) +int(163) +int(164) +int(165) +int(166) +int(167) +int(168) +int(169) +int(170) +int(171) +int(172) +int(173) +int(174) +int(175) +int(176) +int(177) +int(178) +int(179) +int(180) +int(181) +int(182) +int(183) +int(184) +int(185) +int(186) +int(187) +int(188) +int(189) +int(190) +int(191) +int(192) +int(193) +int(194) +int(195) +int(196) +int(197) +int(198) +int(199) +Done diff --git a/ext/oci8/tests/bug27303_4.phpt b/ext/oci8/tests/bug27303_4.phpt new file mode 100644 index 0000000000..70b8d8f36c --- /dev/null +++ b/ext/oci8/tests/bug27303_4.phpt @@ -0,0 +1,257 @@ +--TEST-- +bug #27303 (OCIBindByName binds numeric PHP values as characters) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +string(1) "1" +string(1) "2" +string(1) "3" +string(1) "4" +string(1) "5" +string(1) "6" +string(1) "7" +string(1) "8" +string(1) "9" +string(2) "10" +string(2) "11" +string(2) "12" +string(2) "13" +string(2) "14" +string(2) "15" +string(2) "16" +string(2) "17" +string(2) "18" +string(2) "19" +string(2) "20" +string(2) "21" +string(2) "22" +string(2) "23" +string(2) "24" +string(2) "25" +string(2) "26" +string(2) "27" +string(2) "28" +string(2) "29" +string(2) "30" +string(2) "31" +string(2) "32" +string(2) "33" +string(2) "34" +string(2) "35" +string(2) "36" +string(2) "37" +string(2) "38" +string(2) "39" +string(2) "40" +string(2) "41" +string(2) "42" +string(2) "43" +string(2) "44" +string(2) "45" +string(2) "46" +string(2) "47" +string(2) "48" +string(2) "49" +string(2) "50" +string(2) "51" +string(2) "52" +string(2) "53" +string(2) "54" +string(2) "55" +string(2) "56" +string(2) "57" +string(2) "58" +string(2) "59" +string(2) "60" +string(2) "61" +string(2) "62" +string(2) "63" +string(2) "64" +string(2) "65" +string(2) "66" +string(2) "67" +string(2) "68" +string(2) "69" +string(2) "70" +string(2) "71" +string(2) "72" +string(2) "73" +string(2) "74" +string(2) "75" +string(2) "76" +string(2) "77" +string(2) "78" +string(2) "79" +string(2) "80" +string(2) "81" +string(2) "82" +string(2) "83" +string(2) "84" +string(2) "85" +string(2) "86" +string(2) "87" +string(2) "88" +string(2) "89" +string(2) "90" +string(2) "91" +string(2) "92" +string(2) "93" +string(2) "94" +string(2) "95" +string(2) "96" +string(2) "97" +string(2) "98" +string(2) "99" +string(3) "100" +string(3) "101" +string(3) "102" +string(3) "103" +string(3) "104" +string(3) "105" +string(3) "106" +string(3) "107" +string(3) "108" +string(3) "109" +string(3) "110" +string(3) "111" +string(3) "112" +string(3) "113" +string(3) "114" +string(3) "115" +string(3) "116" +string(3) "117" +string(3) "118" +string(3) "119" +string(3) "120" +string(3) "121" +string(3) "122" +string(3) "123" +string(3) "124" +string(3) "125" +string(3) "126" +string(3) "127" +string(3) "128" +string(3) "129" +string(3) "130" +string(3) "131" +string(3) "132" +string(3) "133" +string(3) "134" +string(3) "135" +string(3) "136" +string(3) "137" +string(3) "138" +string(3) "139" +string(3) "140" +string(3) "141" +string(3) "142" +string(3) "143" +string(3) "144" +string(3) "145" +string(3) "146" +string(3) "147" +string(3) "148" +string(3) "149" +string(3) "150" +string(3) "151" +string(3) "152" +string(3) "153" +string(3) "154" +string(3) "155" +string(3) "156" +string(3) "157" +string(3) "158" +string(3) "159" +string(3) "160" +string(3) "161" +string(3) "162" +string(3) "163" +string(3) "164" +string(3) "165" +string(3) "166" +string(3) "167" +string(3) "168" +string(3) "169" +string(3) "170" +string(3) "171" +string(3) "172" +string(3) "173" +string(3) "174" +string(3) "175" +string(3) "176" +string(3) "177" +string(3) "178" +string(3) "179" +string(3) "180" +string(3) "181" +string(3) "182" +string(3) "183" +string(3) "184" +string(3) "185" +string(3) "186" +string(3) "187" +string(3) "188" +string(3) "189" +string(3) "190" +string(3) "191" +string(3) "192" +string(3) "193" +string(3) "194" +string(3) "195" +string(3) "196" +string(3) "197" +string(3) "198" +string(3) "199" +Done diff --git a/ext/oci8/tests/bug32325.phpt b/ext/oci8/tests/bug32325.phpt new file mode 100644 index 0000000000..1b5dd0d24d --- /dev/null +++ b/ext/oci8/tests/bug32325.phpt @@ -0,0 +1,44 @@ +--TEST-- +bug #32325 (Can't retrieve collection using OCI8) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +size()); +var_dump($collection->getelem(1)); +var_dump($collection->getelem(2)); + +$drop_stmt = oci_parse($c, "drop type ut_num_list_t"); +oci_execute($drop_stmt); + +echo "Done\n"; +?> +--EXPECTF-- +int(4) +float(2) +float(3) +Done diff --git a/ext/oci8/tests/close.phpt b/ext/oci8/tests/close.phpt new file mode 100644 index 0000000000..08bac05ba5 --- /dev/null +++ b/ext/oci8/tests/close.phpt @@ -0,0 +1,22 @@ +--TEST-- +connect/close/connect +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +Done diff --git a/ext/oci8/tests/coll_001.phpt b/ext/oci8/tests/coll_001.phpt new file mode 100644 index 0000000000..8a223f864b --- /dev/null +++ b/ext/oci8/tests/coll_001.phpt @@ -0,0 +1,33 @@ +--TEST-- +oci_new_collection() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +object(OCI-Collection)#%d (1) { + ["collection"]=> + resource(%d) of type (oci8 collection) +} + +Warning: oci_new_collection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d +bool(false) +Done diff --git a/ext/oci8/tests/coll_002.phpt b/ext/oci8/tests/coll_002.phpt new file mode 100644 index 0000000000..39f0dbf065 --- /dev/null +++ b/ext/oci8/tests/coll_002.phpt @@ -0,0 +1,36 @@ +--TEST-- +oci_new_collection() + free() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +free()); +var_dump($coll1->size()); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECTF-- +object(OCI-Collection)#%d (1) { + ["collection"]=> + resource(%d) of type (oci8 collection) +} +bool(true) + +Warning: OCI-Collection::size(): %d is not a valid oci8 collection resource in %s on line %d +bool(false) +Done diff --git a/ext/oci8/tests/coll_002_func.phpt b/ext/oci8/tests/coll_002_func.phpt new file mode 100644 index 0000000000..4a7cb209c3 --- /dev/null +++ b/ext/oci8/tests/coll_002_func.phpt @@ -0,0 +1,36 @@ +--TEST-- +oci_new_collection() + free() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +object(OCI-Collection)#%d (1) { + ["collection"]=> + resource(%d) of type (oci8 collection) +} +bool(true) + +Warning: oci_collection_size(): %d is not a valid oci8 collection resource in %s on line %d +bool(false) +Done diff --git a/ext/oci8/tests/coll_003.phpt b/ext/oci8/tests/coll_003.phpt new file mode 100644 index 0000000000..a47816ad2c --- /dev/null +++ b/ext/oci8/tests/coll_003.phpt @@ -0,0 +1,40 @@ +--TEST-- +collection methods +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +size()); +var_dump($coll1->max()); +var_dump($coll1->trim(3)); +var_dump($coll1->append(1)); +var_dump($coll1->getElem(0)); +var_dump($coll1->assignElem(0,2)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECTF-- +int(0) +int(0) + +Warning: OCI-Collection::trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d +bool(false) +bool(true) +float(1) +bool(true) +Done diff --git a/ext/oci8/tests/coll_003_func.phpt b/ext/oci8/tests/coll_003_func.phpt new file mode 100644 index 0000000000..2057b6361a --- /dev/null +++ b/ext/oci8/tests/coll_003_func.phpt @@ -0,0 +1,40 @@ +--TEST-- +collection methods +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +int(0) +int(0) + +Warning: oci_collection_trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d +bool(false) +bool(true) +float(1) +bool(true) +Done diff --git a/ext/oci8/tests/coll_004.phpt b/ext/oci8/tests/coll_004.phpt new file mode 100644 index 0000000000..4af6d1d907 --- /dev/null +++ b/ext/oci8/tests/coll_004.phpt @@ -0,0 +1,35 @@ +--TEST-- +oci_collection_assign() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append(1)); + +var_dump($coll2->assign($coll1)); + +var_dump($coll2->getElem(0)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECT-- +bool(true) +bool(true) +float(1) +Done diff --git a/ext/oci8/tests/coll_004_func.phpt b/ext/oci8/tests/coll_004_func.phpt new file mode 100644 index 0000000000..9d7f5f6cd9 --- /dev/null +++ b/ext/oci8/tests/coll_004_func.phpt @@ -0,0 +1,35 @@ +--TEST-- +oci_collection_assign() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +float(1) +Done diff --git a/ext/oci8/tests/coll_005.phpt b/ext/oci8/tests/coll_005.phpt new file mode 100644 index 0000000000..d43c856cc7 --- /dev/null +++ b/ext/oci8/tests/coll_005.phpt @@ -0,0 +1,33 @@ +--TEST-- +ocinewcollection() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +object(OCI-Collection)#%d (1) { + ["collection"]=> + resource(%d) of type (oci8 collection) +} + +Warning: ocinewcollection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d +bool(false) +Done diff --git a/ext/oci8/tests/coll_006.phpt b/ext/oci8/tests/coll_006.phpt new file mode 100644 index 0000000000..a1039987f9 --- /dev/null +++ b/ext/oci8/tests/coll_006.phpt @@ -0,0 +1,36 @@ +--TEST-- +ocinewcollection() + free() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +free()); +var_dump($coll1->size()); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECTF-- +object(OCI-Collection)#%d (1) { + ["collection"]=> + resource(%d) of type (oci8 collection) +} +bool(true) + +Warning: OCI-Collection::size(): %d is not a valid oci8 collection resource in %s on line %d +bool(false) +Done diff --git a/ext/oci8/tests/coll_006_func.phpt b/ext/oci8/tests/coll_006_func.phpt new file mode 100644 index 0000000000..f43c142c40 --- /dev/null +++ b/ext/oci8/tests/coll_006_func.phpt @@ -0,0 +1,36 @@ +--TEST-- +ocinewcollection() + free() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +object(OCI-Collection)#%d (1) { + ["collection"]=> + resource(%d) of type (oci8 collection) +} +bool(true) + +Warning: oci_collection_size(): %d is not a valid oci8 collection resource in %s on line %d +bool(false) +Done diff --git a/ext/oci8/tests/coll_007.phpt b/ext/oci8/tests/coll_007.phpt new file mode 100644 index 0000000000..256ce0bfa7 --- /dev/null +++ b/ext/oci8/tests/coll_007.phpt @@ -0,0 +1,40 @@ +--TEST-- +collection methods +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +size()); +var_dump($coll1->max()); +var_dump($coll1->trim(3)); +var_dump($coll1->append(1)); +var_dump($coll1->getElem(0)); +var_dump($coll1->assignElem(0,2)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECTF-- +int(0) +int(0) + +Warning: OCI-Collection::trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d +bool(false) +bool(true) +float(1) +bool(true) +Done diff --git a/ext/oci8/tests/coll_008.phpt b/ext/oci8/tests/coll_008.phpt new file mode 100644 index 0000000000..36e052b7ed --- /dev/null +++ b/ext/oci8/tests/coll_008.phpt @@ -0,0 +1,35 @@ +--TEST-- +ocicollassign() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append(1)); + +var_dump($coll2->assign($coll1)); + +var_dump($coll2->getElem(0)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECT-- +bool(true) +bool(true) +float(1) +Done diff --git a/ext/oci8/tests/coll_009.phpt b/ext/oci8/tests/coll_009.phpt new file mode 100644 index 0000000000..1910af9efb --- /dev/null +++ b/ext/oci8/tests/coll_009.phpt @@ -0,0 +1,48 @@ +--TEST-- +collections and wrong dates +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append("2005-07-28")); + +var_dump($coll2->assign($coll1)); + +var_dump($coll2->getElem(0)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECTF-- +Warning: OCI-Collection::append(): OCI-01861: literal does not match format string in %s on line %d +bool(false) +bool(true) +bool(false) +Done diff --git a/ext/oci8/tests/coll_009_func.phpt b/ext/oci8/tests/coll_009_func.phpt new file mode 100644 index 0000000000..d383abe4ad --- /dev/null +++ b/ext/oci8/tests/coll_009_func.phpt @@ -0,0 +1,48 @@ +--TEST-- +collections and wrong dates +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +Warning: oci_collection_append(): OCI-01861: literal does not match format string in %s on line %d +bool(false) +bool(true) +bool(false) +Done diff --git a/ext/oci8/tests/coll_010.phpt b/ext/oci8/tests/coll_010.phpt new file mode 100644 index 0000000000..b23096206e --- /dev/null +++ b/ext/oci8/tests/coll_010.phpt @@ -0,0 +1,47 @@ +--TEST-- +collections and nulls +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append(null)); + +var_dump($coll2->assign($coll1)); + +var_dump($coll2->getElem(0)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECT-- +bool(true) +bool(true) +NULL +Done diff --git a/ext/oci8/tests/coll_010_func.phpt b/ext/oci8/tests/coll_010_func.phpt new file mode 100644 index 0000000000..dff980e013 --- /dev/null +++ b/ext/oci8/tests/coll_010_func.phpt @@ -0,0 +1,47 @@ +--TEST-- +collections and nulls +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +NULL +Done diff --git a/ext/oci8/tests/coll_011.phpt b/ext/oci8/tests/coll_011.phpt new file mode 100644 index 0000000000..448b7f9a6b --- /dev/null +++ b/ext/oci8/tests/coll_011.phpt @@ -0,0 +1,49 @@ +--TEST-- +collections and strings +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append("string")); +var_dump($coll1->append("string")); + +var_dump($coll2->assign($coll1)); + +var_dump($coll2->getElem(0)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECT-- +bool(true) +bool(true) +bool(true) +string(6) "string" +Done diff --git a/ext/oci8/tests/coll_011_func.phpt b/ext/oci8/tests/coll_011_func.phpt new file mode 100644 index 0000000000..3226d15b86 --- /dev/null +++ b/ext/oci8/tests/coll_011_func.phpt @@ -0,0 +1,49 @@ +--TEST-- +collections and strings +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(true) +string(6) "string" +Done diff --git a/ext/oci8/tests/coll_012.phpt b/ext/oci8/tests/coll_012.phpt new file mode 100644 index 0000000000..59383b0cbc --- /dev/null +++ b/ext/oci8/tests/coll_012.phpt @@ -0,0 +1,47 @@ +--TEST-- +collections and correct dates +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append("28-JUL-05")); + +var_dump($coll2->assign($coll1)); + +var_dump($coll2->getElem(0)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECT-- +bool(true) +bool(true) +string(9) "28-JUL-05" +Done diff --git a/ext/oci8/tests/coll_012_func.phpt b/ext/oci8/tests/coll_012_func.phpt new file mode 100644 index 0000000000..16b85097d4 --- /dev/null +++ b/ext/oci8/tests/coll_012_func.phpt @@ -0,0 +1,47 @@ +--TEST-- +collections and correct dates +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +string(9) "28-JUL-05" +Done diff --git a/ext/oci8/tests/coll_013.phpt b/ext/oci8/tests/coll_013.phpt new file mode 100644 index 0000000000..cd1c851771 --- /dev/null +++ b/ext/oci8/tests/coll_013.phpt @@ -0,0 +1,44 @@ +--TEST-- +collections and correct dates (2) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append("28-JUL-05")); +var_dump($coll1->assignElem(0,"01-JAN-05")); +var_dump($coll1->getElem(0)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECT-- +bool(true) +bool(true) +string(9) "01-JAN-05" +Done diff --git a/ext/oci8/tests/coll_013_func.phpt b/ext/oci8/tests/coll_013_func.phpt new file mode 100644 index 0000000000..6141105b01 --- /dev/null +++ b/ext/oci8/tests/coll_013_func.phpt @@ -0,0 +1,44 @@ +--TEST-- +collections and correct dates (2) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +string(9) "01-JAN-05" +Done diff --git a/ext/oci8/tests/coll_014.phpt b/ext/oci8/tests/coll_014.phpt new file mode 100644 index 0000000000..abbdbff274 --- /dev/null +++ b/ext/oci8/tests/coll_014.phpt @@ -0,0 +1,44 @@ +--TEST-- +collections and strings (2) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append("striing")); +var_dump($coll1->assignElem(0,"blah")); +var_dump($coll1->getElem(0)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECT-- +bool(true) +bool(true) +string(4) "blah" +Done diff --git a/ext/oci8/tests/coll_014_func.phpt b/ext/oci8/tests/coll_014_func.phpt new file mode 100644 index 0000000000..a728ee0f7d --- /dev/null +++ b/ext/oci8/tests/coll_014_func.phpt @@ -0,0 +1,44 @@ +--TEST-- +collections and strings (2) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +string(4) "blah" +Done diff --git a/ext/oci8/tests/coll_015.phpt b/ext/oci8/tests/coll_015.phpt new file mode 100644 index 0000000000..c9f9bda941 --- /dev/null +++ b/ext/oci8/tests/coll_015.phpt @@ -0,0 +1,44 @@ +--TEST-- +collections and numbers (2) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append(1)); +var_dump($coll1->assignElem(0,2345)); +var_dump($coll1->getElem(0)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECT-- +bool(true) +bool(true) +float(2345) +Done diff --git a/ext/oci8/tests/coll_015_func.phpt b/ext/oci8/tests/coll_015_func.phpt new file mode 100644 index 0000000000..27c4e68cd4 --- /dev/null +++ b/ext/oci8/tests/coll_015_func.phpt @@ -0,0 +1,44 @@ +--TEST-- +collections and numbers (2) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +float(2345) +Done diff --git a/ext/oci8/tests/coll_016.phpt b/ext/oci8/tests/coll_016.phpt new file mode 100644 index 0000000000..3f685dd73f --- /dev/null +++ b/ext/oci8/tests/coll_016.phpt @@ -0,0 +1,54 @@ +--TEST-- +collections and negative/too big element indexes +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append(1)); +var_dump($coll1->assignElem(-1,2345)); +var_dump($coll1->assignElem(5000,2345)); +var_dump($coll1->getElem(-1)); +var_dump($coll1->getElem(-100)); +var_dump($coll1->getElem(500)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECTF-- +bool(true) + +Warning: OCI-Collection::assignelem(): OCI-22165: given index [4294967295] must be in the range of 0 to [0] in %s on line %d +bool(false) + +Warning: OCI-Collection::assignelem(): OCI-22165: given index [5000] must be in the range of 0 to [0] in %s on line %d +bool(false) +bool(false) +bool(false) +bool(false) +Done diff --git a/ext/oci8/tests/coll_016_func.phpt b/ext/oci8/tests/coll_016_func.phpt new file mode 100644 index 0000000000..f9ba14db49 --- /dev/null +++ b/ext/oci8/tests/coll_016_func.phpt @@ -0,0 +1,54 @@ +--TEST-- +collections and negative/too big element indexes +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +bool(true) + +Warning: oci_collection_element_assign(): OCI-22165: given index [4294967295] must be in the range of 0 to [0] in %s on line %d +bool(false) + +Warning: oci_collection_element_assign(): OCI-22165: given index [5000] must be in the range of 0 to [0] in %s on line %d +bool(false) +bool(false) +bool(false) +bool(false) +Done diff --git a/ext/oci8/tests/coll_017.phpt b/ext/oci8/tests/coll_017.phpt new file mode 100644 index 0000000000..2ba0ce5382 --- /dev/null +++ b/ext/oci8/tests/coll_017.phpt @@ -0,0 +1,44 @@ +--TEST-- +collections and nulls (2) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- +append("string")); +var_dump($coll1->assignElem(0, null)); +var_dump($coll1->getElem(0)); + +echo "Done\n"; + +require dirname(__FILE__)."/drop_type.inc"; + +?> +--EXPECT-- +bool(true) +bool(true) +NULL +Done diff --git a/ext/oci8/tests/coll_017_func.phpt b/ext/oci8/tests/coll_017_func.phpt new file mode 100644 index 0000000000..ada10a192d --- /dev/null +++ b/ext/oci8/tests/coll_017_func.phpt @@ -0,0 +1,44 @@ +--TEST-- +collections and nulls (2) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +NULL +Done diff --git a/ext/oci8/tests/commit.phpt b/ext/oci8/tests/commit.phpt new file mode 100644 index 0000000000..7a44a31a9b --- /dev/null +++ b/ext/oci8/tests/commit.phpt @@ -0,0 +1,153 @@ +--TEST-- +oci_commit()/oci_rollback() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +int(0) +array(5) { + ["ID"]=> + array(0) { + } + ["VALUE"]=> + array(0) { + } + ["BLOB"]=> + array(0) { + } + ["CLOB"]=> + array(0) { + } + ["STRING"]=> + array(0) { + } +} +bool(true) +int(4) +array(5) { + ["ID"]=> + array(4) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + string(1) "1" + [3]=> + string(1) "1" + } + ["VALUE"]=> + array(4) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + string(1) "1" + [3]=> + string(1) "1" + } + ["BLOB"]=> + array(4) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + [3]=> + NULL + } + ["CLOB"]=> + array(4) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + [3]=> + NULL + } + ["STRING"]=> + array(4) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + [3]=> + NULL + } +} +Done diff --git a/ext/oci8/tests/commit_old.phpt b/ext/oci8/tests/commit_old.phpt new file mode 100644 index 0000000000..3dfb383113 --- /dev/null +++ b/ext/oci8/tests/commit_old.phpt @@ -0,0 +1,151 @@ +--TEST-- +ocicommit()/ocirollback() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +int(0) +array(5) { + ["ID"]=> + array(0) { + } + ["VALUE"]=> + array(0) { + } + ["BLOB"]=> + array(0) { + } + ["CLOB"]=> + array(0) { + } + ["STRING"]=> + array(0) { + } +} +bool(true) +int(4) +array(5) { + ["ID"]=> + array(4) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + string(1) "1" + [3]=> + string(1) "1" + } + ["VALUE"]=> + array(4) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + string(1) "1" + [3]=> + string(1) "1" + } + ["BLOB"]=> + array(4) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + [3]=> + NULL + } + ["CLOB"]=> + array(4) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + [3]=> + NULL + } + ["STRING"]=> + array(4) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + [3]=> + NULL + } +} +Done diff --git a/ext/oci8/tests/connect.inc b/ext/oci8/tests/connect.inc index a0013e20d7..887c8fdaa1 100644 --- a/ext/oci8/tests/connect.inc +++ b/ext/oci8/tests/connect.inc @@ -4,29 +4,27 @@ * Please, change user, password and dbase to match your configuration. * * */ - -$user = "user"; -$password = "pass"; -$dbase = "base"; + +$user = "system"; +$password = "system"; +$dbase = "oracle"; /* * You should have privileges to create tables in this schema * * */ - -$schema = "system"; - /* - * Remove the last line in skipif.inc to run tests - * - * */ - +$schema = "system"; +*/ +$table_name = "tb".substr(str_replace(Array(".", "-"), "_", php_uname("n")), 0, 5); +$type_name = strtoupper("tp".substr(str_replace(Array(".", "-"), "_", php_uname("n")), 0, 5)); + if (!empty($dbase)) { - $connection = ocilogon($user,$password,$dbase); + $c = ocilogon($user,$password,$dbase); } else { - $connection = ocilogon($user,$password); + $c = ocilogon($user,$password); } if (!empty($schema)) { diff --git a/ext/oci8/tests/connect.phpt b/ext/oci8/tests/connect.phpt new file mode 100644 index 0000000000..d873a7e015 --- /dev/null +++ b/ext/oci8/tests/connect.phpt @@ -0,0 +1,27 @@ +--TEST-- +oci_connect() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 connection) +Done diff --git a/ext/oci8/tests/connect_1.phpt b/ext/oci8/tests/connect_1.phpt new file mode 100644 index 0000000000..e658344496 --- /dev/null +++ b/ext/oci8/tests/connect_1.phpt @@ -0,0 +1,40 @@ +--TEST-- +oci_pconnect() & oci_new_connect() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 persistent connection) +resource(%d) of type (oci8 connection) +bool(true) +bool(true) +Done diff --git a/ext/oci8/tests/connect_1_old.phpt b/ext/oci8/tests/connect_1_old.phpt new file mode 100644 index 0000000000..73c756159d --- /dev/null +++ b/ext/oci8/tests/connect_1_old.phpt @@ -0,0 +1,40 @@ +--TEST-- +ociplogon() & ocinlogon() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 persistent connection) +resource(%d) of type (oci8 connection) +bool(true) +bool(true) +Done diff --git a/ext/oci8/tests/connect_old.phpt b/ext/oci8/tests/connect_old.phpt new file mode 100644 index 0000000000..a8183d4ec8 --- /dev/null +++ b/ext/oci8/tests/connect_old.phpt @@ -0,0 +1,27 @@ +--TEST-- +ocilogon() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 connection) +Done diff --git a/ext/oci8/tests/connect_without_oracle_home.phpt b/ext/oci8/tests/connect_without_oracle_home.phpt new file mode 100644 index 0000000000..513d60cefd --- /dev/null +++ b/ext/oci8/tests/connect_without_oracle_home.phpt @@ -0,0 +1,25 @@ +--TEST-- +oci_connect() without ORACLE_HOME set (OCIServerAttach() segfaults) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: ocilogon(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect.inc on line %d + +Warning: oci_connect(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect_without_oracle_home.php on line %d +bool(false) +Done diff --git a/ext/oci8/tests/connect_without_oracle_home_old.phpt b/ext/oci8/tests/connect_without_oracle_home_old.phpt new file mode 100644 index 0000000000..68b11de155 --- /dev/null +++ b/ext/oci8/tests/connect_without_oracle_home_old.phpt @@ -0,0 +1,25 @@ +--TEST-- +ocilogon() without ORACLE_HOME set (OCIServerAttach() segfaults) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: ocilogon(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect.inc on line %d + +Warning: oci_connect(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect_without_oracle_home.php on line %d +bool(false) +Done diff --git a/ext/oci8/tests/create_table.inc b/ext/oci8/tests/create_table.inc index c423ce577d..d6debf2339 100644 --- a/ext/oci8/tests/create_table.inc +++ b/ext/oci8/tests/create_table.inc @@ -1,11 +1,18 @@ diff --git a/ext/oci8/tests/cursor_bind_err.phpt b/ext/oci8/tests/cursor_bind_err.phpt new file mode 100644 index 0000000000..343167387b --- /dev/null +++ b/ext/oci8/tests/cursor_bind_err.phpt @@ -0,0 +1,53 @@ +--TEST-- +binding a cursor (with errors) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +Warning: oci_bind_by_name(): ORA-01036: illegal variable name/number in %s on line %d + +Warning: oci_fetch_assoc(): ORA-24338: statement handle not executed in %s on line %d +bool(false) +Done diff --git a/ext/oci8/tests/cursors.phpt b/ext/oci8/tests/cursors.phpt new file mode 100644 index 0000000000..e69ff82dd2 --- /dev/null +++ b/ext/oci8/tests/cursors.phpt @@ -0,0 +1,64 @@ +--TEST-- +fetching cursor from a statement +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +array(2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +bool(true) + +Warning: oci_fetch_assoc()%sORA-01002: fetch out of sequence in %scursors.php on line %d +bool(false) +bool(true) +Done diff --git a/ext/oci8/tests/cursors_old.phpt b/ext/oci8/tests/cursors_old.phpt new file mode 100644 index 0000000000..4991ed795a --- /dev/null +++ b/ext/oci8/tests/cursors_old.phpt @@ -0,0 +1,69 @@ +--TEST-- +fetching cursor from a statement +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +array(2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +bool(true) + +Warning: ocifetchinto():%sORA-01002: fetch out of sequence in %scursors_old.php on line %d +array(2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +bool(true) +Done diff --git a/ext/oci8/tests/debug.phpt b/ext/oci8/tests/debug.phpt new file mode 100644 index 0000000000..2a2d2f79c2 --- /dev/null +++ b/ext/oci8/tests/debug.phpt @@ -0,0 +1,36 @@ +--TEST-- +oci_internal_debug() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +OCI8 DEBUG: OCINlsEnvironmentVariableGet in php_oci_do_connect_ex() (%s/oci8.c:%d) +Done +OCI8 DEBUG: OCISessionEnd in php_oci_connection_close() (%s/oci8.c:%d) +OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) +OCI8 DEBUG: OCIServerDetach in php_oci_connection_close() (%s/oci8.c:%d) +OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) +OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) +OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) +OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) diff --git a/ext/oci8/tests/default_prefetch.phpt b/ext/oci8/tests/default_prefetch.phpt new file mode 100644 index 0000000000..46d2d07e4c --- /dev/null +++ b/ext/oci8/tests/default_prefetch.phpt @@ -0,0 +1,55 @@ +--TEST-- +oci8.default_prefetch ini option +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--INI-- +oci8.default_prefetch=20 +--FILE-- + +--EXPECT-- +bool(true) +int(1) +Done diff --git a/ext/oci8/tests/default_prefetch1.phpt b/ext/oci8/tests/default_prefetch1.phpt new file mode 100644 index 0000000000..8f43450c84 --- /dev/null +++ b/ext/oci8/tests/default_prefetch1.phpt @@ -0,0 +1,55 @@ +--TEST-- +oci8.default_prefetch ini option +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--INI-- +oci8.default_prefetch=100 +--FILE-- + +--EXPECT-- +bool(true) +int(1) +Done diff --git a/ext/oci8/tests/default_prefetch2.phpt b/ext/oci8/tests/default_prefetch2.phpt new file mode 100644 index 0000000000..8a0939cdc1 --- /dev/null +++ b/ext/oci8/tests/default_prefetch2.phpt @@ -0,0 +1,58 @@ +--TEST-- +oci8.default_prefetch ini option +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--INI-- +oci8.default_prefetch=100 +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +int(1) +Done diff --git a/ext/oci8/tests/define.phpt b/ext/oci8/tests/define.phpt new file mode 100644 index 0000000000..dde5d575b3 --- /dev/null +++ b/ext/oci8/tests/define.phpt @@ -0,0 +1,46 @@ +--TEST-- +oci_define_by_name() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +string(4) "some" +Done diff --git a/ext/oci8/tests/define_old.phpt b/ext/oci8/tests/define_old.phpt new file mode 100644 index 0000000000..e3c8278668 --- /dev/null +++ b/ext/oci8/tests/define_old.phpt @@ -0,0 +1,46 @@ +--TEST-- +ocidefinebyname() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +string(4) "some" +Done diff --git a/ext/oci8/tests/drop_table.inc b/ext/oci8/tests/drop_table.inc index 4e558f5e33..ffd99f5af3 100644 --- a/ext/oci8/tests/drop_table.inc +++ b/ext/oci8/tests/drop_table.inc @@ -1,11 +1,11 @@ diff --git a/ext/oci8/tests/error.phpt b/ext/oci8/tests/error.phpt new file mode 100644 index 0000000000..594a3d1319 --- /dev/null +++ b/ext/oci8/tests/error.phpt @@ -0,0 +1,45 @@ +--TEST-- +oci_error() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%s) of type (oci8 connection) +resource(%s) of type (oci8 statement) + +Warning: oci_execute(): ORA-00900: invalid SQL statement in %s on line %d +bool(false) +array(4) { + ["code"]=> + int(900) + ["message"]=> + string(32) "ORA-00900: invalid SQL statement" + ["offset"]=> + int(0) + ["sqltext"]=> + string(12) "WRONG SYNTAX" +} +Done diff --git a/ext/oci8/tests/error_old.phpt b/ext/oci8/tests/error_old.phpt new file mode 100644 index 0000000000..fbdcd9e610 --- /dev/null +++ b/ext/oci8/tests/error_old.phpt @@ -0,0 +1,45 @@ +--TEST-- +ocierror() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%s) of type (oci8 connection) +resource(%s) of type (oci8 statement) + +Warning: ociexecute(): ORA-00900: invalid SQL statement in %s on line %d +bool(false) +array(4) { + ["code"]=> + int(900) + ["message"]=> + string(32) "ORA-00900: invalid SQL statement" + ["offset"]=> + int(0) + ["sqltext"]=> + string(12) "WRONG SYNTAX" +} +Done diff --git a/ext/oci8/tests/exec_fetch.phpt b/ext/oci8/tests/exec_fetch.phpt new file mode 100644 index 0000000000..e1705273aa --- /dev/null +++ b/ext/oci8/tests/exec_fetch.phpt @@ -0,0 +1,24 @@ +--TEST-- +fetch after failed oci_execute() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +Done diff --git a/ext/oci8/tests/fetch.phpt b/ext/oci8/tests/fetch.phpt new file mode 100644 index 0000000000..72ca9f3f80 --- /dev/null +++ b/ext/oci8/tests/fetch.phpt @@ -0,0 +1,61 @@ +--TEST-- +ocifetch() & ociresult() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +string(1) "1" +string(1) "1" +string(1) "1" +string(1) "1" +string(1) "1" +string(1) "1" +Done diff --git a/ext/oci8/tests/fetch_all.phpt b/ext/oci8/tests/fetch_all.phpt new file mode 100644 index 0000000000..49193ffc87 --- /dev/null +++ b/ext/oci8/tests/fetch_all.phpt @@ -0,0 +1,154 @@ +--TEST-- +oci_fetch_all() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +int(3) +array(5) { + ["ID"]=> + array(3) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + string(1) "1" + } + ["VALUE"]=> + array(3) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + string(1) "1" + } + ["BLOB"]=> + array(3) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + } + ["CLOB"]=> + array(3) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + } + ["STRING"]=> + array(3) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + } +} +int(3) +array(5) { + ["ID"]=> + array(3) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + string(1) "1" + } + ["VALUE"]=> + array(3) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + string(1) "1" + } + ["BLOB"]=> + array(3) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + } + ["CLOB"]=> + array(3) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + } + ["STRING"]=> + array(3) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL + } +} +Done diff --git a/ext/oci8/tests/fetch_array.phpt b/ext/oci8/tests/fetch_array.phpt new file mode 100644 index 0000000000..ada162453d --- /dev/null +++ b/ext/oci8/tests/fetch_array.phpt @@ -0,0 +1,235 @@ +--TEST-- +oci_fetch_array() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +array(4) { + [0]=> + string(1) "1" + ["ID"]=> + string(1) "1" + [1]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(4) { + [0]=> + string(1) "1" + ["ID"]=> + string(1) "1" + [1]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(4) { + [0]=> + string(1) "1" + ["ID"]=> + string(1) "1" + [1]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +array(2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(4) { + [0]=> + string(1) "1" + ["ID"]=> + string(1) "1" + [1]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(4) { + [0]=> + string(1) "1" + ["ID"]=> + string(1) "1" + [1]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(4) { + [0]=> + string(1) "1" + ["ID"]=> + string(1) "1" + [1]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +Done diff --git a/ext/oci8/tests/fetch_assoc.phpt b/ext/oci8/tests/fetch_assoc.phpt new file mode 100644 index 0000000000..9b6866a100 --- /dev/null +++ b/ext/oci8/tests/fetch_assoc.phpt @@ -0,0 +1,69 @@ +--TEST-- +oci_fetch_assoc() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +array(2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +array(2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +Done diff --git a/ext/oci8/tests/fetch_into.phpt b/ext/oci8/tests/fetch_into.phpt new file mode 100644 index 0000000000..4953a25026 --- /dev/null +++ b/ext/oci8/tests/fetch_into.phpt @@ -0,0 +1,87 @@ +--TEST-- +ocifetchinto() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +int(5) +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +int(5) +array(10) { + [0]=> + string(1) "1" + ["ID"]=> + string(1) "1" + [1]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" + [2]=> + NULL + ["BLOB"]=> + NULL + [3]=> + NULL + ["CLOB"]=> + NULL + [4]=> + NULL + ["STRING"]=> + NULL +} +Done diff --git a/ext/oci8/tests/fetch_into1.phpt b/ext/oci8/tests/fetch_into1.phpt new file mode 100644 index 0000000000..91d02e3d5c --- /dev/null +++ b/ext/oci8/tests/fetch_into1.phpt @@ -0,0 +1,197 @@ +--TEST-- +various ocifetchinto() tests +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +int(5) +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +int(5) +array(2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +int(5) +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +int(5) +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +int(5) +array(4) { + [0]=> + string(1) "1" + ["ID"]=> + string(1) "1" + [1]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +int(5) +array(10) { + [0]=> + string(1) "1" + ["ID"]=> + string(1) "1" + [1]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" + [2]=> + NULL + ["BLOB"]=> + NULL + [3]=> + NULL + ["CLOB"]=> + NULL + [4]=> + NULL + ["STRING"]=> + NULL +} +int(5) +array(10) { + [0]=> + string(1) "1" + ["ID"]=> + string(1) "1" + [1]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" + [2]=> + NULL + ["BLOB"]=> + NULL + [3]=> + NULL + ["CLOB"]=> + NULL + [4]=> + NULL + ["STRING"]=> + NULL +} +int(5) +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +int(5) +array(5) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" + ["BLOB"]=> + NULL + ["CLOB"]=> + NULL + ["STRING"]=> + NULL +} +int(5) +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +Done diff --git a/ext/oci8/tests/fetch_into2.phpt b/ext/oci8/tests/fetch_into2.phpt new file mode 100644 index 0000000000..27c137b429 --- /dev/null +++ b/ext/oci8/tests/fetch_into2.phpt @@ -0,0 +1,75 @@ +--TEST-- +ocifetchinto() & wrong number of params +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +Warning: ocifetchinto() expects at least 2 parameters, 1 given in %s on line %d +NULL + +Notice: Undefined variable: all in %s on line %d +NULL + +Warning: ocifetchinto() expects at most 3 parameters, 4 given in %s on line %d +NULL +NULL + +Warning: ocifetchinto(): supplied resource is not a valid oci8 statement resource in %s on line %d +bool(false) +NULL +int(5) +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +Done diff --git a/ext/oci8/tests/fetch_object.phpt b/ext/oci8/tests/fetch_object.phpt new file mode 100644 index 0000000000..2df0480a39 --- /dev/null +++ b/ext/oci8/tests/fetch_object.phpt @@ -0,0 +1,69 @@ +--TEST-- +oci_fetch_object() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +object(stdClass)#1 (2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +object(stdClass)#2 (2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +object(stdClass)#1 (2) { + ["ID"]=> + string(1) "1" + ["VALUE"]=> + string(1) "1" +} +Done diff --git a/ext/oci8/tests/fetch_row.phpt b/ext/oci8/tests/fetch_row.phpt new file mode 100644 index 0000000000..a2c0e883a0 --- /dev/null +++ b/ext/oci8/tests/fetch_row.phpt @@ -0,0 +1,69 @@ +--TEST-- +oci_fetch_row() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} +Done diff --git a/ext/oci8/tests/field_funcs.phpt b/ext/oci8/tests/field_funcs.phpt new file mode 100644 index 0000000000..bba6632e86 --- /dev/null +++ b/ext/oci8/tests/field_funcs.phpt @@ -0,0 +1,110 @@ +--TEST-- +oci_field_*() family +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + $field) { + $num++; + var_dump(oci_field_is_null($s, $num)); + var_dump(oci_field_name($s, $num)); + var_dump(oci_field_type($s, $num)); + var_dump(oci_field_type_raw($s, $num)); + var_dump(oci_field_scale($s, $num)); + var_dump(oci_field_precision($s, $num)); + var_dump(oci_field_size($s, $num)); +} + + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECT-- +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +bool(false) +string(2) "ID" +string(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(false) +string(5) "VALUE" +string(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(true) +string(4) "BLOB" +string(4) "BLOB" +int(113) +int(0) +int(0) +int(4000) +bool(true) +string(4) "CLOB" +string(4) "CLOB" +int(112) +int(0) +int(0) +int(4000) +bool(true) +string(6) "STRING" +string(7) "VARCHAR" +int(1) +int(0) +int(0) +int(10) +Done diff --git a/ext/oci8/tests/field_funcs_old.phpt b/ext/oci8/tests/field_funcs_old.phpt new file mode 100644 index 0000000000..c5339a7502 --- /dev/null +++ b/ext/oci8/tests/field_funcs_old.phpt @@ -0,0 +1,110 @@ +--TEST-- +ocicolumn*() family +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + $field) { + $num++; + var_dump(ocicolumnisnull($s, $num)); + var_dump(ocicolumnname($s, $num)); + var_dump(ocicolumntype($s, $num)); + var_dump(ocicolumntyperaw($s, $num)); + var_dump(ocicolumnscale($s, $num)); + var_dump(ocicolumnprecision($s, $num)); + var_dump(ocicolumnsize($s, $num)); +} + + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECT-- +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL +} +bool(false) +string(2) "ID" +string(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(false) +string(5) "VALUE" +string(6) "NUMBER" +int(2) +int(0) +int(0) +int(22) +bool(true) +string(4) "BLOB" +string(4) "BLOB" +int(113) +int(0) +int(0) +int(4000) +bool(true) +string(4) "CLOB" +string(4) "CLOB" +int(112) +int(0) +int(0) +int(4000) +bool(true) +string(6) "STRING" +string(7) "VARCHAR" +int(1) +int(0) +int(0) +int(10) +Done diff --git a/ext/oci8/tests/lob_001.phpt b/ext/oci8/tests/lob_001.phpt new file mode 100644 index 0000000000..405b2b814c Binary files /dev/null and b/ext/oci8/tests/lob_001.phpt differ diff --git a/ext/oci8/tests/lob_002.phpt b/ext/oci8/tests/lob_002.phpt new file mode 100644 index 0000000000..c414905f39 --- /dev/null +++ b/ext/oci8/tests/lob_002.phpt @@ -0,0 +1,71 @@ +--TEST-- +oci_lob_write() and friends (with errors) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +write("test", -1)); +var_dump($blob->write("test", "str")); +var_dump($blob->write("test", 1000000)); +var_dump($blob->write(str_repeat("test", 10000), 1000000)); +var_dump($blob->tell()); +var_dump($blob->seek("str", -5)); +var_dump($blob->flush()); + +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name.""; +$s = oci_parse($c, $select_sql); +oci_execute($s); + +$row = oci_fetch_array($s, OCI_RETURN_LOBS); + +var_dump(strlen($row[0])); + + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECTF-- +object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +int(0) + +Warning: OCI-Lob::write() expects parameter 2 to be long, string given in %slob_002.php on line %d +NULL +int(4) +int(40000) +int(40004) + +Warning: OCI-Lob::seek() expects parameter 1 to be long, string given in %slob_002.php on line %d +NULL +bool(false) +int(40004) +Done diff --git a/ext/oci8/tests/lob_003.phpt b/ext/oci8/tests/lob_003.phpt new file mode 100644 index 0000000000..76f1a7e4b0 Binary files /dev/null and b/ext/oci8/tests/lob_003.phpt differ diff --git a/ext/oci8/tests/lob_004.phpt b/ext/oci8/tests/lob_004.phpt new file mode 100644 index 0000000000..56ccfbcd4a --- /dev/null +++ b/ext/oci8/tests/lob_004.phpt @@ -0,0 +1,85 @@ +--TEST-- +oci_lob_seek()/rewind()/append() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +write("test")); +var_dump($blob->rewind()); +var_dump($blob->write("str")); +var_dump($blob->seek(10, OCI_SEEK_SET)); + +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; +$s = oci_parse($c, $select_sql); +oci_execute($s, OCI_DEFAULT); + +var_dump($row = oci_fetch_array($s)); + +var_dump($row[0]->append($blob)); +var_dump($row[0]->read(10000)); + +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; +$s = oci_parse($c, $select_sql); +oci_execute($s, OCI_DEFAULT); + +$row = oci_fetch_array($s); + +var_dump($row[0]->read(10000)); + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECTF-- +object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +int(4) +bool(true) +int(3) +bool(true) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + ["BLOB"]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +bool(true) +string(4) "strt" +string(8) "strtstrt" +Done diff --git a/ext/oci8/tests/lob_005.phpt b/ext/oci8/tests/lob_005.phpt new file mode 100644 index 0000000000..d82400e47e --- /dev/null +++ b/ext/oci8/tests/lob_005.phpt @@ -0,0 +1,57 @@ +--TEST-- +oci_lob_is_equal() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + ["BLOB"]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +bool(true) +Done diff --git a/ext/oci8/tests/lob_006.phpt b/ext/oci8/tests/lob_006.phpt new file mode 100644 index 0000000000..321d948b1a Binary files /dev/null and b/ext/oci8/tests/lob_006.phpt differ diff --git a/ext/oci8/tests/lob_007.phpt b/ext/oci8/tests/lob_007.phpt new file mode 100644 index 0000000000..0f2920414f --- /dev/null +++ b/ext/oci8/tests/lob_007.phpt @@ -0,0 +1,71 @@ +--TEST-- +oci_lob_write()/size()/load() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +size()); +var_dump($blob->write(str_repeat("string.", 1000))); +var_dump($blob->size()); +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; +$s = oci_parse($c, $select_sql); +oci_execute($s, OCI_DEFAULT); + +var_dump($row = oci_fetch_array($s)); + +var_dump($row[0]->size()); +var_dump(strlen($row[0]->load())); + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECTF-- +object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +int(0) +int(7000) +int(7000) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + ["BLOB"]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +int(7000) +int(7000) +Done diff --git a/ext/oci8/tests/lob_008.phpt b/ext/oci8/tests/lob_008.phpt new file mode 100644 index 0000000000..a0b4a557df --- /dev/null +++ b/ext/oci8/tests/lob_008.phpt @@ -0,0 +1,70 @@ +--TEST-- +oci_lob_write()/read()/eof() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +write(str_repeat("string.", 1000))); +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; +$s = oci_parse($c, $select_sql); +oci_execute($s, OCI_DEFAULT); + +var_dump($row = oci_fetch_array($s)); + + +$len = 0; +while (!$row[0]->eof()) { + $len += strlen($row[0]->read(1024)); +} +var_dump($len); + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECTF-- +object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +int(7000) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + ["BLOB"]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +int(7000) +Done diff --git a/ext/oci8/tests/lob_009.phpt b/ext/oci8/tests/lob_009.phpt new file mode 100644 index 0000000000..9b467dd12a --- /dev/null +++ b/ext/oci8/tests/lob_009.phpt @@ -0,0 +1,74 @@ +--TEST-- +oci_lob_import()/read() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +seek(10, OCI_SEEK_CUR)); +var_dump($blob->import(dirname(__FILE__)."/lob_009.txt")); +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; +$s = oci_parse($c, $select_sql); +oci_execute($s, OCI_DEFAULT); + +var_dump($row = oci_fetch_array($s)); + +while (!$row[0]->eof()) { + var_dump($row[0]->read(1024)); +} + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECTF-- +object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) +} +bool(true) +bool(true) +array(2) { + [0]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + ["BLOB"]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +string(43) "this +is +a +test +file for +test lob_009.phpt +" +Done diff --git a/ext/oci8/tests/lob_009.txt b/ext/oci8/tests/lob_009.txt new file mode 100644 index 0000000000..f57bc8af37 --- /dev/null +++ b/ext/oci8/tests/lob_009.txt @@ -0,0 +1,6 @@ +this +is +a +test +file for +test lob_009.phpt diff --git a/ext/oci8/tests/lob_010.phpt b/ext/oci8/tests/lob_010.phpt new file mode 100644 index 0000000000..85d37dc738 --- /dev/null +++ b/ext/oci8/tests/lob_010.phpt @@ -0,0 +1,51 @@ +--TEST-- +oci_lob_save() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +save("string")); +var_dump($blob->save("string", 3)); +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; +$s = oci_parse($c, $select_sql); +oci_execute($s, OCI_DEFAULT); + +$row = oci_fetch_array($s); + +while (!$row[0]->eof()) { + var_dump($row[0]->read(1024)); +} + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECT-- +bool(true) +bool(true) +string(9) "strstring" +Done diff --git a/ext/oci8/tests/lob_011.phpt b/ext/oci8/tests/lob_011.phpt new file mode 100644 index 0000000000..41d54cf147 --- /dev/null +++ b/ext/oci8/tests/lob_011.phpt @@ -0,0 +1,81 @@ +--TEST-- +oci_lob_copy() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +write("some string here. string, I said")); +oci_commit($c); + +$ora_sql = "INSERT INTO + ".$schema.$table_name." (id, blob) + VALUES (2, empty_blob()) + RETURNING + blob + INTO :v_blob "; + +$statement = oci_parse($c,$ora_sql); +$blob = oci_new_descriptor($c,OCI_D_LOB); +oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); +oci_execute($statement, OCI_DEFAULT); + +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 1"; +$s = oci_parse($c, $select_sql); +oci_execute($s); + +$row1 = oci_fetch_array($s); + +$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 2 FOR UPDATE"; +$s = oci_parse($c, $select_sql); +oci_execute($s, OCI_DEFAULT); + +$row2 = oci_fetch_array($s); + +var_dump(oci_lob_copy($row2[0], $row1[0])); +var_dump($row1[0]->read(100)); + +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 2 FOR UPDATE"; +$s = oci_parse($c, $select_sql); +oci_execute($s, OCI_DEFAULT); + +var_dump($row2 = oci_fetch_array($s, OCI_RETURN_LOBS)); + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECT-- +int(32) +bool(true) +string(32) "some string here. string, I said" +array(1) { + [0]=> + string(32) "some string here. string, I said" +} +Done diff --git a/ext/oci8/tests/lob_012.phpt b/ext/oci8/tests/lob_012.phpt new file mode 100644 index 0000000000..fb434d9260 --- /dev/null +++ b/ext/oci8/tests/lob_012.phpt @@ -0,0 +1,55 @@ +--TEST-- +oci_lob_export() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +write("test string is here\nnew string")); + +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; +$s = oci_parse($c, $select_sql); +oci_execute($s, OCI_DEFAULT); + +$row = oci_fetch_array($s); + +var_dump($row[0]->export(dirname(__FILE__)."/lob_012.tmp", 3, 10)); + +var_dump(file_get_contents(dirname(__FILE__)."/lob_012.tmp")); + +@unlink(dirname(__FILE__)."/lob_012.tmp"); + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECT-- +int(30) +bool(true) +string(10) "t string i" +Done diff --git a/ext/oci8/tests/lob_013.phpt b/ext/oci8/tests/lob_013.phpt new file mode 100644 index 0000000000..608640c7a1 --- /dev/null +++ b/ext/oci8/tests/lob_013.phpt @@ -0,0 +1,59 @@ +--TEST-- +lob buffering +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +write("test")); +var_dump($blob->getBuffering()); +var_dump($blob->setBuffering(true)); +var_dump($blob->write("test")); +var_dump($blob->getBuffering()); +var_dump($blob->flush()); + +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name.""; +$s = oci_parse($c, $select_sql); +oci_execute($s); + +$row = oci_fetch_array($s, OCI_RETURN_LOBS); + +var_dump($row[0]); + + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECT-- +int(4) +bool(false) +bool(true) +int(4) +bool(true) +bool(true) +string(8) "testtest" +Done diff --git a/ext/oci8/tests/lob_014.phpt b/ext/oci8/tests/lob_014.phpt new file mode 100644 index 0000000000..b0e0db5a01 --- /dev/null +++ b/ext/oci8/tests/lob_014.phpt @@ -0,0 +1,63 @@ +--TEST-- +oci_lob_free()/close() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +write("test")); +var_dump($blob->close()); +var_dump($blob->write("test")); +var_dump($blob->free()); +var_dump($blob->write("test")); + +oci_commit($c); + +$select_sql = "SELECT blob FROM ".$schema.$table_name.""; +$s = oci_parse($c, $select_sql); +oci_execute($s); + +var_dump(oci_fetch_array($s, OCI_NUM + OCI_RETURN_LOBS)); + +require dirname(__FILE__).'/drop_table.inc'; + +echo "Done\n"; + +?> +--EXPECTF-- +int(4) + +Warning: OCI-Lob::close(): ORA-22289: cannot perform operation on an unopened file or LOB in %slob_014.php on line %d +bool(false) +int(4) +bool(true) + +Warning: OCI-Lob::write(): %d is not a valid oci8 descriptor resource in %slob_014.php on line %d +bool(false) +array(1) { + [0]=> + string(8) "testtest" +} +Done diff --git a/ext/oci8/tests/lob_015.phpt b/ext/oci8/tests/lob_015.phpt new file mode 100644 index 0000000000..5419087888 --- /dev/null +++ b/ext/oci8/tests/lob_015.phpt @@ -0,0 +1,56 @@ +--TEST-- +various tests with wrong param count +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +Warning: oci_new_descriptor() expects at most 2 parameters, 5 given in %slob_015.php on line %d + +Warning: oci_bind_by_name() expects at most 5 parameters, 6 given in %slob_015.php on line %d + +Warning: oci_bind_by_name() expects at most 5 parameters, 7 given in %slob_015.php on line %d + +Notice: Object of class OCI-Lob to string conversion in %slob_015.php on line %d + +Warning: oci_bind_by_name() expects at least 3 parameters, 2 given in %slob_015.php on line %d + +Warning: oci_bind_by_name() expects at least 3 parameters, 1 given in %slob_015.php on line %d + +Warning: oci_execute(): ORA-00932: inconsistent datatypes: expected NUMBER got BLOB in %slob_015.php on line %d +string(6) "Object" +Done diff --git a/ext/oci8/tests/lob_016.phpt b/ext/oci8/tests/lob_016.phpt new file mode 100644 index 0000000000..d021cc3ac8 --- /dev/null +++ b/ext/oci8/tests/lob_016.phpt @@ -0,0 +1,72 @@ +--TEST-- +returning multiple lobs +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +write("first"); +$row['LOB_2']->write("second"); + +unset($row); + +oci_commit($c); + +$select = "SELECT * FROM lob_test FOR UPDATE"; +$statement = oci_parse($c, $select); +oci_execute($statement, OCI_DEFAULT); + +$row = oci_fetch_assoc($statement); + +var_dump($row); +var_dump($row['LOB_1']->load()); +var_dump($row['LOB_2']->load()); + +$drop = "DROP table lob_test"; +$statement = oci_parse($c, $drop); +@oci_execute($statement); + +echo "Done\n"; + +?> +--EXPECTF-- +array(2) { + ["LOB_1"]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + ["LOB_2"]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +string(5) "first" +string(6) "second" +Done diff --git a/ext/oci8/tests/lob_017.phpt b/ext/oci8/tests/lob_017.phpt new file mode 100644 index 0000000000..43b4a513b3 --- /dev/null +++ b/ext/oci8/tests/lob_017.phpt @@ -0,0 +1,74 @@ +--TEST-- +returning multiple lobs (using persistent connection) +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +write("first"); +$row['LOB_2']->write("second"); + +unset($row); + +oci_commit($c); + +$select = "SELECT * FROM lob_test FOR UPDATE"; +$statement = oci_parse($c, $select); +oci_execute($statement, OCI_DEFAULT); + +$row = oci_fetch_assoc($statement); + +var_dump($row); +var_dump($row['LOB_1']->load()); +var_dump($row['LOB_2']->load()); + +$drop = "DROP table lob_test"; +$statement = oci_parse($c, $drop); +@oci_execute($statement); + +echo "Done\n"; + +?> +--EXPECTF-- +array(2) { + ["LOB_1"]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } + ["LOB_2"]=> + object(OCI-Lob)#%d (1) { + ["descriptor"]=> + resource(%d) of type (oci8 descriptor) + } +} +string(5) "first" +string(6) "second" +Done diff --git a/ext/oci8/tests/lob_018.phpt b/ext/oci8/tests/lob_018.phpt new file mode 100644 index 0000000000..360f50f387 --- /dev/null +++ b/ext/oci8/tests/lob_018.phpt @@ -0,0 +1,72 @@ +--TEST-- +fetching the same lob several times +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +save("data"); + +oci_commit($c); + +$init = "INSERT INTO lob_test (mykey, lob_1) VALUES(2, EMPTY_CLOB()) RETURNING lob_1 INTO :mylob"; +$statement = oci_parse($c, $init); +$clob = oci_new_descriptor($c, OCI_D_LOB); +oci_bind_by_name($statement, ":mylob", $clob, -1, OCI_B_CLOB); +oci_execute($statement, OCI_DEFAULT); +$clob->save("long data"); + +oci_commit($c); + + +$query = 'SELECT * FROM lob_test ORDER BY mykey ASC'; +$statement = oci_parse ($c, $query); +oci_execute($statement, OCI_DEFAULT); + +while ($row = oci_fetch_array($statement, OCI_ASSOC)) { + $result = $row['LOB_1']->load(); + var_dump($result); +} + +$query = 'SELECT * FROM lob_test ORDER BY mykey DESC'; +$statement = oci_parse ($c, $query); +oci_execute($statement, OCI_DEFAULT); + +while ($row = oci_fetch_array($statement, OCI_ASSOC)) { + $result = $row['LOB_1']->load(); + var_dump($result); +} + +$drop = "DROP table lob_test"; +$statement = oci_parse($c, $drop); +@oci_execute($statement); + +echo "Done\n"; + +?> +--EXPECTF-- +string(4) "data" +string(9) "long data" +string(9) "long data" +string(4) "data" +Done diff --git a/ext/oci8/tests/lob_temp.phpt b/ext/oci8/tests/lob_temp.phpt new file mode 100644 index 0000000000..4532d53630 --- /dev/null +++ b/ext/oci8/tests/lob_temp.phpt @@ -0,0 +1,41 @@ +--TEST-- +temporary lobs +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +writeTemporary("test")); +var_dump($blob->load()); +var_dump($blob->seek(0, SEEK_SET)); +var_dump($blob->read(2)); + +$c = oci_pconnect($user, $password, $dbase); + +$blob = oci_new_descriptor($c,OCI_D_LOB); +var_dump($blob->writeTemporary("test")); +var_dump($blob->load()); +var_dump($blob->seek(0, SEEK_SET)); +var_dump($blob->read(2)); + +echo "Done\n"; + +?> +--EXPECTF-- +bool(true) +string(4) "test" +bool(true) +string(2) "te" +bool(true) +string(4) "test" +bool(true) +string(2) "te" +Done diff --git a/ext/oci8/tests/lob_temp1.phpt b/ext/oci8/tests/lob_temp1.phpt new file mode 100644 index 0000000000..563a7e1f26 --- /dev/null +++ b/ext/oci8/tests/lob_temp1.phpt @@ -0,0 +1,37 @@ +--TEST-- +closing temporary lobs +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +writeTemporary("test")); +var_dump($blob->load()); +var_dump($blob->close()); + +$c = oci_pconnect($user, $password, $dbase); + +$blob = oci_new_descriptor($c,OCI_D_LOB); +var_dump($blob->writeTemporary("test")); +var_dump($blob->load()); +var_dump($blob->close()); + +echo "Done\n"; + +?> +--EXPECTF-- +bool(true) +string(4) "test" +bool(true) +bool(true) +string(4) "test" +bool(true) +Done diff --git a/ext/oci8/tests/num.phpt b/ext/oci8/tests/num.phpt new file mode 100644 index 0000000000..34b1a9c07d --- /dev/null +++ b/ext/oci8/tests/num.phpt @@ -0,0 +1,71 @@ +--TEST-- +oci_num_*() family +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +int(0) +int(0) +int(5) +int(5) +int(3) +Done diff --git a/ext/oci8/tests/oci_execute_segfault.phpt b/ext/oci8/tests/oci_execute_segfault.phpt new file mode 100644 index 0000000000..b7f0b62c85 --- /dev/null +++ b/ext/oci8/tests/oci_execute_segfault.phpt @@ -0,0 +1,35 @@ +--TEST-- +oci_execute() segfault after repeated bind +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +Done diff --git a/ext/oci8/tests/old_oci_close.phpt b/ext/oci8/tests/old_oci_close.phpt new file mode 100644 index 0000000000..beb1b34ab5 --- /dev/null +++ b/ext/oci8/tests/old_oci_close.phpt @@ -0,0 +1,28 @@ +--TEST-- +oci8.old_oci_close_semantics On +--SKIPIF-- + +--INI-- +oci8.old_oci_close_semantics=1 +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 connection) +NULL +resource(%d) of type (oci8 statement) +Done diff --git a/ext/oci8/tests/old_oci_close1.phpt b/ext/oci8/tests/old_oci_close1.phpt new file mode 100644 index 0000000000..c79eb077be --- /dev/null +++ b/ext/oci8/tests/old_oci_close1.phpt @@ -0,0 +1,30 @@ +--TEST-- +oci8.old_oci_close_semantics Off +--SKIPIF-- + +--INI-- +oci8.old_oci_close_semantics=0 +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 connection) +bool(true) + +Warning: oci_parse() expects parameter 1 to be resource, null given in %s on line %d +NULL +Done diff --git a/ext/oci8/tests/password.phpt b/ext/oci8/tests/password.phpt new file mode 100644 index 0000000000..37f586cd4f --- /dev/null +++ b/ext/oci8/tests/password.phpt @@ -0,0 +1,35 @@ +--TEST-- +oci_password_change() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 connection) +resource(%d) of type (oci8 connection) +resource(%d) of type (oci8 connection) +Done diff --git a/ext/oci8/tests/password_new.phpt b/ext/oci8/tests/password_new.phpt new file mode 100644 index 0000000000..37f586cd4f --- /dev/null +++ b/ext/oci8/tests/password_new.phpt @@ -0,0 +1,35 @@ +--TEST-- +oci_password_change() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 connection) +resource(%d) of type (oci8 connection) +resource(%d) of type (oci8 connection) +Done diff --git a/ext/oci8/tests/password_old.phpt b/ext/oci8/tests/password_old.phpt new file mode 100644 index 0000000000..3e715785b5 --- /dev/null +++ b/ext/oci8/tests/password_old.phpt @@ -0,0 +1,35 @@ +--TEST-- +ocipasswordchange() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +bool(true) +resource(%d) of type (oci8 connection) +bool(true) +Done diff --git a/ext/oci8/tests/persistent.phpt b/ext/oci8/tests/persistent.phpt new file mode 100644 index 0000000000..088689c722 --- /dev/null +++ b/ext/oci8/tests/persistent.phpt @@ -0,0 +1,32 @@ +--TEST-- +reusing persistent connections +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 persistent connection) +resource(%d) of type (oci8 persistent connection) +resource(%d) of type (oci8 persistent connection) +resource(%d) of type (oci8 connection) +resource(%d) of type (oci8 connection) +resource(%d) of type (oci8 connection) +Done diff --git a/ext/oci8/tests/prefetch.phpt b/ext/oci8/tests/prefetch.phpt new file mode 100644 index 0000000000..45d51bd4c3 --- /dev/null +++ b/ext/oci8/tests/prefetch.phpt @@ -0,0 +1,56 @@ +--TEST-- +oci_set_prefetch() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +int(1) +Done diff --git a/ext/oci8/tests/prefetch_old.phpt b/ext/oci8/tests/prefetch_old.phpt new file mode 100644 index 0000000000..189511d051 --- /dev/null +++ b/ext/oci8/tests/prefetch_old.phpt @@ -0,0 +1,56 @@ +--TEST-- +ocisetprefetch() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +int(1) +Done diff --git a/ext/oci8/tests/privileged_connect.phpt b/ext/oci8/tests/privileged_connect.phpt new file mode 100644 index 0000000000..aef94b79e1 --- /dev/null +++ b/ext/oci8/tests/privileged_connect.phpt @@ -0,0 +1,31 @@ +--TEST-- +privileged connect tests +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA in %s on line %d + +Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA in %s on line %d + +Warning: oci_connect(): Invalid session mode specified (-1) in %s on line %d + +Warning: oci_connect() expects parameter 5 to be long, string given in %s on line %d +Done diff --git a/ext/oci8/tests/privileged_connect1.phpt b/ext/oci8/tests/privileged_connect1.phpt new file mode 100644 index 0000000000..208d0853c4 --- /dev/null +++ b/ext/oci8/tests/privileged_connect1.phpt @@ -0,0 +1,33 @@ +--TEST-- +privileged connect tests +--INI-- +oci8.privileged_connect=1 +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +Warning: oci_connect(): ORA-01031: insufficient privileges in %s on line %d + +Warning: oci_connect(): ORA-01031: insufficient privileges in %s on line %d + +Warning: oci_connect(): Invalid session mode specified (-1) in %s on line %d + +Warning: oci_connect() expects parameter 5 to be long, string given in %s on line %d +Done diff --git a/ext/oci8/tests/serverversion.phpt b/ext/oci8/tests/serverversion.phpt new file mode 100644 index 0000000000..0a8059964b --- /dev/null +++ b/ext/oci8/tests/serverversion.phpt @@ -0,0 +1,35 @@ +--TEST-- +oci_server_version() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 connection) +string(%d) "%s" +string(%d) "%s" +Done diff --git a/ext/oci8/tests/statement_cache.phpt b/ext/oci8/tests/statement_cache.phpt new file mode 100644 index 0000000000..dc49c427f2 --- /dev/null +++ b/ext/oci8/tests/statement_cache.phpt @@ -0,0 +1,40 @@ +--TEST-- +statement cache +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +array(2) { + [0]=> + string(1) "4" + ["1+3"]=> + string(1) "4" +} +array(2) { + [0]=> + string(1) "4" + ["1+3"]=> + string(1) "4" +} +Done diff --git a/ext/oci8/tests/statement_type.phpt b/ext/oci8/tests/statement_type.phpt new file mode 100644 index 0000000000..f3215ec31e --- /dev/null +++ b/ext/oci8/tests/statement_type.phpt @@ -0,0 +1,51 @@ +--TEST-- +oci_statement_type() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 connection) +string(6) "SELECT" +string(6) "DELETE" +string(6) "INSERT" +string(6) "UPDATE" +string(4) "DROP" +string(6) "CREATE" +string(7) "UNKNOWN" +string(7) "UNKNOWN" +Done diff --git a/ext/oci8/tests/statement_type_old.phpt b/ext/oci8/tests/statement_type_old.phpt new file mode 100644 index 0000000000..587beb4f2c --- /dev/null +++ b/ext/oci8/tests/statement_type_old.phpt @@ -0,0 +1,51 @@ +--TEST-- +ocistatementtype() +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- + +--EXPECTF-- +resource(%d) of type (oci8 connection) +string(6) "SELECT" +string(6) "DELETE" +string(6) "INSERT" +string(6) "UPDATE" +string(4) "DROP" +string(6) "CREATE" +string(7) "UNKNOWN" +string(7) "UNKNOWN" +Done diff --git a/ext/oci8/tests/uncommitted.phpt b/ext/oci8/tests/uncommitted.phpt new file mode 100644 index 0000000000..297b7b0d06 --- /dev/null +++ b/ext/oci8/tests/uncommitted.phpt @@ -0,0 +1,22 @@ +--TEST-- +uncommitted connection +--SKIPIF-- + +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." +"; +--FILE-- + +--EXPECTF-- +Done