summaryrefslogtreecommitdiff
path: root/ext/oci8
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-01-30 11:43:07 +0000
committerAntony Dovgal <tony2001@php.net>2007-01-30 11:43:07 +0000
commitfdec496b73457a0028a6fc386f2b26375b175b34 (patch)
treec3a4e946435dd3f252e0c8b04a75ccc836ea86bd /ext/oci8
parentc9a866884742e43ef2911085f2bc7c604fe6ff8c (diff)
downloadphp-git-fdec496b73457a0028a6fc386f2b26375b175b34.tar.gz
improve test
patch by Chris Jones
Diffstat (limited to 'ext/oci8')
-rw-r--r--ext/oci8/tests/bind_empty.phpt97
1 files changed, 95 insertions, 2 deletions
diff --git a/ext/oci8/tests/bind_empty.phpt b/ext/oci8/tests/bind_empty.phpt
index 9c602b32c3..ec630fadc5 100644
--- a/ext/oci8/tests/bind_empty.phpt
+++ b/ext/oci8/tests/bind_empty.phpt
@@ -4,7 +4,7 @@ binding empty values
<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
--FILE--
<?php
-
+
require dirname(__FILE__).'/connect.inc';
$drop = "DROP table bind_test";
@@ -16,18 +16,57 @@ $statement = oci_parse($c, $create);
oci_execute($statement);
+echo "Test 1\n";
+
$name = null;
$stmt = oci_parse($c, "UPDATE bind_test SET name=:name");
oci_bind_by_name($stmt, ":name", $name);
-$res = oci_execute($stmt);
+var_dump(oci_execute($stmt));
+
+echo "Test 2\n";
$name = "";
$stmt = oci_parse($c, "UPDATE bind_test SET name=:name");
oci_bind_by_name($stmt, ":name", $name);
+var_dump(oci_execute($stmt));
+
+echo "Test 3\n";
+
+$stmt = oci_parse($c, "INSERT INTO bind_test (NAME) VALUES ('abc')");
$res = oci_execute($stmt);
+$stmt = oci_parse($c, "INSERT INTO bind_test (NAME) VALUES ('def')");
+$res = oci_execute($stmt);
+
+$name = null;
+$stmt = oci_parse($c, "UPDATE bind_test SET name=:name WHERE NAME = 'abc'");
+oci_bind_by_name($stmt, ":name", $name);
+
+var_dump(oci_execute($stmt));
+
+$stid = oci_parse($c, "select * from bind_test order by 1");
+oci_execute($stid);
+oci_fetch_all($stid, $res);
+var_dump($res);
+
+echo "Test 4\n";
+
+$name = "";
+$stmt = oci_parse($c, "UPDATE bind_test SET name=:name WHERE NAME = 'def'");
+oci_bind_by_name($stmt, ":name", $name);
+
+var_dump(oci_execute($stmt));
+
+$stid = oci_parse($c, "select * from bind_test order by 1");
+oci_execute($stid);
+oci_fetch_all($stid, $res);
+var_dump($res);
+
+
+// Clean up
+
$drop = "DROP table bind_test";
$statement = oci_parse($c, $drop);
@oci_execute($statement);
@@ -36,4 +75,58 @@ echo "Done\n";
?>
--EXPECTF--
+Test 1
+bool(true)
+Test 2
+bool(true)
+Test 3
+bool(true)
+array(1) {
+ ["NAME"]=>
+ array(2) {
+ [0]=>
+ string(3) "def"
+ [1]=>
+ NULL
+ }
+}
+Test 4
+bool(true)
+array(1) {
+ ["NAME"]=>
+ array(2) {
+ [0]=>
+ NULL
+ [1]=>
+ NULL
+ }
+}
+Done
+--UEXPECTF--
+Test 1
+bool(true)
+Test 2
+bool(true)
+Test 3
+bool(true)
+array(1) {
+ [u"NAME"]=>
+ array(2) {
+ [0]=>
+ unicode(3) "def"
+ [1]=>
+ NULL
+ }
+}
+Test 4
+bool(true)
+array(1) {
+ [u"NAME"]=>
+ array(2) {
+ [0]=>
+ NULL
+ [1]=>
+ NULL
+ }
+}
Done